Create a consist on the track ... lay another temporary straight track ... move the consist to the temporary straight track ... Use the Trainz ruler to measure it in feet or meters
Or make a 1 mile long consist (5280 feet) on a temporary straight track, measured with the Trainz ruler in feet or meters ... and save that as a "New Consist" "5280 Foot Consist" ... Place a overly bright railcar on each end, making the 2 ends easy to see ... Move the train to your mainline, and use that "New Consist" "5280 Foot Consist" as a bendable measuring stick on your mainline