Everybody assumes this has something to with visibility, however this is not the case.
The Roman Legions built the first massive intercity roads for purposes of insuring the rapid movement of troops and carriages.
Of necessity those roads and viaducts over mountain passes and through valleys were narrow. When not in military use they were packed with civilians, farmers, cows and sheep being moved to market.
When the legion had to move those roads had to be clear.
The color of a Centurian's plume was blood red.
When the legion required a road for a military movement a red flag was placed in position, and for a civilian to pass that flag and block the road - the penalty was death.
And that is how the red flag came into being and how "red" came to be the color of stoplights.