This isn't the same thing - in the cases of terrorist caused and police caused deaths, there were human beings who acted to intentionally kill someone else. In the case of railroad crossings, there isn't such intentionality.
You can spend money to construct safer railway crossings, you can spend money to hire more cops or NSA operatives, you can spend money to educate cops, or you can make rule that all cars must have safety devices that stop them if they intend to cross railway when a train is coming, which will make cars more expensive, and so on and so on.
Never the less to prioritize these, statistics are important.