The Idea here is that red flashing light is run from battery power if none of the lights have power. The light is a cluster of high intensity red LEDs that and a flashing circuit like the one commonly used by on bicycles.
A device could be made to retrofit most traffic lights used in the world today at a cost of less than $10 each. If the circuit was designed to flash if the red light hadn't had power in about two minutes, the cost would even be lower.
An adaption of this could make use of a devices to listen for trains and flash a warning light.