TRS2004 has a built-in odometer. I'm not sure if it's present in other versions of Trainz. To enable it load the session in Surveyor, then:
Edit Session Rules > Add > Display Custom HUD > Click the OK tick.
Left click once on "Display Custom HUD" so as to select it > Edit > Select the "Show the custom heads up display" option > Click the OK tick.
Click the OK tick to exit "Edit Session Rules".
Then when you run the session it will display the distance travelled as you drive your loco along the track.
HTH, John