Maybe this is what you are looking for:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ([^/]+)/([^/]+)/([\d]+)\.html/? [NC]
RewriteRule .* main/%1/index.php?page=%2&page_id=%3 [L]
Will redirect internally:
http://example.com/main/LangCode/PageName/PageID.html
To:
http://example.com/main/LangCode/index.php?page=PageName&page_id=PageID