In case the M911 command in config.g isn't working, try running M911 without parameters and check the readback.
Also run M122 and check that the reported VIN voltage is above the 22.0V threshold that you set in M911. If it is below then the power loss function won't be primed.
There is a separate reservoir of power feeding the on-board 5V regulator, so that even if the power voltage drops instantly there should still be enough power to write the resurrect.g file, even if there is no power to move the motors. However, a heavy load on the 5V rail could thwart this.