"If the king does not arrive, I will have myself ridden on a rail: if he does I will ride you on a rail instead." (24.13)
Hank is confronting the phony magician here. He's using technology to cheat, since he used the telegraph to figure out where the king was, but he's also using technology to set the terms of the competition. The loser will literally be ridden out of the valley on a rail… you know, the train kind.