Make sure your curves in the track are long enough so that when the train makes the curve, one set of wheels doesn't "derail".
Aside from Mikes mel script, another way to do it is to simply set a key for the wheel at 1 in the timeline. Figure how many frames the train is going to be in motion for and how many times you want the wheel to spin during that time then multiply that times 360. Go to the end of the animation and in the channel box, put that number in the rotate X or Y (depending on which direction the wheel is facing). That way, as the train nears the station, you can space out the timing which will slow down the wheels.
For instance. If you wanted the wheel to make one revolution in 1 second, set a key for the X or Z rotation at 0. Then go to frame 25 (or 30, depending on your fps), change the X or Z rotation to 359 and set a key. Now the wheel will rotate once in one second.
Why do you set the second rotation number to 359 instead of 360? Because 1 and 360 are on the same point in a revolution. In other words, a revolution starts at 1 and ends at 360, but it ends right back where it started from thus having two different values on the same point.
So by putting in 359 for the end value, the animation makes a complete revolution and starts up again at 1. Try it, you'll see what I mean.
Dave Baer
Professor of Digital Arts
Digital Media Arts College
Boca Raton, Florida
dbaer@dmac.edu