Just like real life, we all know there's rules on how to safely cross train tracks. Just like real life, no amount of Minecraft mods will stop a train from hitting if you ignore those rules and play on train tracks. You just can't yog-proof a minecraft train.