As seen in the photo posted to Reddit, the locomotive and DeLorean time machine were both miniatures, albeit quite large ones. Miniature effects used to be quite prominent in films before the advent of CGI, and when done well (as they are in "Back to the Future III"), they can be difficult to spot, especially if you aren't specifically looking out for them (via FXGuide).
If it's been a while since you've seen "Back to the Future III" and you're interested to see how the shot in question looks in the finished film, another helpful Reddit user named u/TooShiftyForYou captured the sequence in GIF form, and added that the sequence uses the same shot of the train pushing the car three different times, but with different layers of visual effects added. This, combined with the construction and editing of the sequence itself, makes it less-than-readily apparent that a shot is being reused multiple times, let alone the miniature nature of the shot itself.
Now that you've gotten a glimpse at how the scene was made, it might make it hard not to see the miniature effects the next time you watch "Back to the Future III." But hopefully this knowledge of the filmmaking craft that went into making the movie will make you appreciate it more, not less.