On the railway a white flag or light meant all-clear, red meant danger or stop and green originally meant caution. With the increasing use of gas and electric white lights the significance of green changed to all clear as of about 1893. As with most changes this took several years to apply, the GWR adopted green for all-clear in 1895 but green was still occasionally associated with a cautionary warning until the 1960's.
Reference:
British Railway Signals
http://www.igg.org.uk/gansg/3-sigs/sigs-1.htm#:~:text=With%20the%20increasing%20use%20of,cautionary%20warning%20until%20the%201960's. (accessed 22May21)