Per the rules, I think the Rod isn't moving and the train is. The rod flies "backward" through the train, punching holes in doors and walls and people. Bad news all round.
But that's a lame outcome. The party is trying to find creative solutions to problems, and as the DM, we want to reward them for doing that. Tell the rogue: "Ordinarily, the rod would align to the reference frame of the ground. It sounds like you're trying to align it to the reference frame of the train floor instead. What skill are you using to do that?"
You wrote that you'd take an answer from any edition, so I'll suggest that this is a great ad-hoc use of the Use Magic Device skill from 3.5e or Pathfinder. On a good roll, the rogue figures out how the rod is identifying its frame of reference, and manages to trick it into using the train floor as its frame of reference instead of the ground. On a bad roll, the Rod goes out of control as before, but the party at least understands why their plan didn't work.
If the group is playing 4e or 5e, there is no Use Magic Device skill, so you'd probably have to call for an Arcana check instead.
Telekinesis, a level 5 spell, says you can manipulate an object. I would think that the example of opening a door is at least as complex as pushing a button on a rod.
You can exert fine control on objects with your telekinetic grip, such as manipulating a simple tool, opening a door or a container, stowing or retrieving an item from an open container, or pouring the contents from a vial.
Also it does not say that you cannot manipulate a magical object. So I think this one is valid.
Unseen Servant, a level 1 spell, should also be able to do it.
The servant can perform simple tasks that a human servant could do, such as fetching things, cleaning, mending, folding clothes, lighting fires, serving food, and pouring wine.
Again, there is nothing saying that it cannot activate a magical item. (However, it would not be able to read a scroll or drink a potion)
However, you say at a distance and the Unseen Servant needs to be able to reach that location. Some people say the Unseen Servant can hover, others say it cannot.
Ten Foot Poles could also be used to push on a button. You do not specify the distance, but there are no reasons why that would not work. Only it may take a few tries (i.e. Dexterity check on a fairly high DC such as DC 16.)
Missiles could also be thrown at it (rocks, arrows, bolts, etc.) However, that may be quite a feat to hit that tiny little button (although a giant can throw big rocks, he! he!)
Best Answer
Rods are given a general description on page 139 of the DMG:
That gives you a general idea and you as DM can narrow it down to where you'd like it to be within those bounds.