When I first got into the hobby, one of my kid's trains started slowing down considerably. Having no hobby lubricants in the house yet, I used some Vaseline on the gears, and the train went back to running as it should. I left the Vaz on the gears until I got some hobby grease, and have seen no damage to this day.
I use WD-40 more as a solvent than anything else. It's great for removing tree sap and road tar.