How Railroad Crossings Work — Practical Engineering
At-grade crossing of railroad need to ensure the safety of motorists against the comparatively short visible distance vs. stopping distance (if the train operator can see you on the track, it is already too late). The current system builds in redundancies to ensure reliability (against road conditions and electrical/mechanical failures) while incorporating motorist psychology (must account for the varying train speed to minimize the motorist waiting time while maintaining the safety margin; build trust in the system to prevent evasive maneuvers).