None of the things you have described are "easy problems". In fact, they are pretty difficult! Systems need to be robust, interoperable, reliable, provably correct, fail safely, deal with surprising edge cases, have long service lives, and any number of other challenges.
In any case, all you've really done here is re-invent technology that already exists. In ETCS level 2, for example, the signalling system uses known-location transmitters on the track as references and the train calculates its position in-between using on-board sensors like axle encoders, IMUs etc.
This is just a short article about an interesting new technology for providing the "train position" component of the system by building a magnetic map of the rails. Pretty cool idea – if it's accurate enough, it provides a more robust source of absolute positioning information, which is key to allowing the rollout of realising "moving-block" approaches in which trains' movement authorities are updated in real-time, allowing higher traffic density.
And it's not like nobody's thought about GPS/GNSS either – there have been extensive projects looking into the feasibility of those systems. The Russian ABTC-M system uses GLONASS, and I'm sure some implementations of PTC in the US use GPS. But again, these are difficult challenges incorporating lots of different technology and you don't solve them overnight.