The solution Crutschow proposes ac holds the relay in, so it goes off when the ac fails, which is wasteful of power because it takes several watts to hold a relay in. It is on for months to years before the ac fails.
A more efficient method is to use a discarded, but small, DC output wall-wart (plug-in charger) for an old cell phone. Use the dc output to hold off a transistor while charging the battery. When the ac power fails, the lack of dc at the output will allow the transistor to turn on, turning on the load.
Using a high-side transistor (either a PNP or PFET) makes this simple.
How much current does it take to light your LED?
What voltage does it take to properly float charge your battery?