The song is best known by the title, "The Red and Green Signal Lights." It was written and copyrighted by Henry V. Neal and Gussie L. Davis in 1896 with the title "Just Set A Light."
A full discussion can be found in "Long Steel Rail" by Norm Cohen (Univ. Illinois Press)