Put up level crossings like in Britain, a complete no go around gate.
Station armed guards with orders to shoot to kill those crossing at the wrong times.
We’ve had railroads for centuries now. Plenty of time for society to get right with the Laws of Physics.