To be fair, many people did die on level crossings and by wandering on to the tracks.
We learned over time to put in place safety fences and tunnels.