making Emergency lighting normal supply and power failure
simulate this circuit &ndash; Schematic created using CircuitLab

Here you go. You just need two diodes rated to carry the maximum lamp current. The higher of the two voltages will power the lamp. The diodes prevent current from one power source running backwards into the other. The mains power supply voltage needs to be slightly higher than the battery's.