Fast 220v AC power failure detection
I will be honest, I have not taken the time to fully understand Spehro's suggestion. But usually his ideas are very good (he is sharp and experienced).

But here is my idea. You could create a model or replica, either digital or analog of the mains waveform that you keep in-sync, time wise with the mains (use some type of phase-lock scheme). If the actual voltage droops significantly below the model voltage at any time, you conclude that mains has failed. Obviously this circuitry would have to have some way to remain powered up after mains is cut off. Good luck. It is a challenging problem to decide when mains has failed. You may have false alarms, so think about the implications of that for your system.