You won't be able to determine the distance using wireless. On a real train you could use GPS but the distances on a model train would be too small for GPS to be useful.
Can you measure the speed of the train by measuring the speed of its motor?
I am building an 00 gauge model train using nRF24's for radio control and I have an optical detector that registers a pulse for every revolution of the motor. That is used for speed control and also I am hoping to be able to use the pulse count for reasonably accurate short term movements together with optical detectors under (or beside) the track for the larger distances.
...R