Each shanty had an electric box connected to the track circuit. There would be 2 lights . . . one marked Eastbound and one marked Westbound.
When a train entered the circuit, the light would go on emitting a noise to attract the attention of the crossing watchman.
He'd then go out and hold up his stop sign, or red lantern or lower the gates if his crossing was so equipped. He had to be notified well in advance, because he'd have to have time to go across the tracks and lower the far side gates, by hand cranking them and then return and lower the near side gates by hand cranking them.
Assuming this was an express train traveling at 70 mph and not intending to stop, he had to move his ass.
Then there were the REALLY busy guards who worked double track territory, especially electric territory. Trains ran along the Babylon-Jamaica portion of the Montauk branch every 30 minutes in each direction. That was a lot of light indicators flashing, and crossing watchmen running back and forth to lower both sets of gates . . . especially when an eastbound AND a westbound passed each other at or near his crossing!
You may have fallen asleep on the job had you been guarding the crossing at South Country Road east of Patchogue, (past MP 54) but you'd be quite awake if you were guarding the crossing at Little East Neck Road west of Babylon or even Deer Park Avenue for that matter with trains going in and out of the yard east of the station! Research: Dave Keller