I've never seen a switchstand lamp on a turntable. I will guess there is a lock on the turntable mechanism that rotates the lamp from red to green. Or maybe it is signal from the operator to the hostler?
Ok, what is it really for?
"ALCO S6 locomotive #4642 on turntable, Date: Circa 1950-60s"