Perhaps PHP is not running as an Apache
module, but as a CGI
program. In this case, you cannot change PHP variables in a .htaccess file, since PHP is just an external program for Apache. I have seen that before.
You can check that creating a single phpinfo.php file with just this text:
<?php phpinfo(); ?>
Among the first lines, you will see one starting by Server API. If it is FastCGI/CGI PHP is not an Apache module, but an external CGI program and that is the problem you are facing. If it is Apache, PHP is an Apache module and there must be another cause.
Anyway, I have found nothing but problems having PHP as a CGI program. I recomend you to avoid it and make it run as an Apache module. One curious thing is that this mode only allows $CFG->dbpersist = false; in your config.php in order to run Moodle properly.
Anyway, if it happened suddently, and you had the php_flag lines working fine before in your .htaccess, you should try the first old, easy trick: just restart apache and pray.
If it does not work try the second old, nasty trick: what was the last change you did before you Moodle stopped working? It is very likely that this was the cause, just undo that change.
Hope this helps.