All trains have to have a red light at the rear. In the bad old days this was an oil lamp, which often glowed slightly if really dark. The introduction of electric lamps was probably earlier than battery technology could provide; light enough to be portable and to last a long time. The flashing reduced the drain on the battery. However, it also drew attention to the lamp, so would be quickly noticed if not working, as it is a single point failure. Virtually all passenger stock, excepting loco hauled with no rear loco or Driving Trailer, has two steady red lights at the rear.
With LED lamps the current draw is much smaller than the incandescent lamps! So there is no need to flash, but folk are used to the flashing and it does draw attention to it, like bicycle lamps.