That sounds like an excellent idea. However I think rail transport depends more heavily on quality infrastructure. If a state doesn’t maintain its roads well and allow potholes to develop, it is probably rare for that to cause a fatal accident (I’ve heard of potholes causing damage to cars but not deaths). But improperly maintained rails lead to derailments and deaths.
Potholes do regularly result in cyclists' deaths.
You may still need a public train service or subsidies of some kind to make sure unprofitable but vital routes get served