Bart Maverick is riding across a hot, desolate Southwestern landscape. Thirsty and out of water, he spots what appears to be a prickly-pear cactus. He attempts to cut off a piece of the cactus, but is jumped by a man who, following a brief skirmish, explains that he is trying to protect the rare "Pachycerus" specimen. He declares that cactus biology is "the love" of his life, although he's "a railroad man." The stranger then introduces himself as Cornelius Van Rensselaer Jr., wealthy railroad heir, who Bart immediately takes to calling "Corny." He tells Maverick that his father is having a special train sent to take him to St. Louis on a nearby spur line. Cornelius asks Bart what he'd doing way out in the desert, and Bart explains that he had to leave a poker game in St. Louis in a hurry because "some people don't know how to lose gracefully." Cornelius says he doubled his allowance at Harvard playing poker and Bart agrees to a little game with him as being "the only wheel in town." Soon enough Bart has only his $1,000 bill in reserve and loses it to "Corny", who beats Bart's flush with a higher one. The railroad heir then offers to pay Bart double his losses if Bart will impersonate him on the train, explaining that if everyone knows who he is, they'll want to socialize. Instead, he wants to work on a presentation about his cactus that he's anxious to give. Being broke, Bart agrees to pretend to be Cornelius Van Rensselaer Jr., wealthy railroad heir.
The train arrives as scheduled and picks up the two men. Meanwhile, back in St. Louis, Cornelius's father reveals he needs his son to come home "by noon tomorrow" for a special business meeting. If Cornelius is absent, "Senior's" competitors will put him out of business. He speculates that his competitors will have filled the train with "hatchet-men" to ensure that "Junior" won't be around to vote against them and save the business. On board, the assorted agents of the competition are introduced, including a Turk called Hakime and a couple traveling together named Jeannie McCabe and McPherson. Also aboard is an old acquaintance of Cornelius's father, Colonel Hamilton, traveling with his winsome but idealistic daughter, Abigail. He suggests that she make the rich heir's acquaintance, but she adamantly refuses.
Meanwhile, Bart is relaxing in "his" private rail car while "Corny" hangs out in the baggage car with his cactus and two horses. Later, Jeannie runs into Maverick as he leaves the private car. Bart picks up Hakime's Turkish newspaper, which is written in Arabic script, and is told by Hakime that the paper belongs to him. Bart replies that he was "merely curious about the weather in Constantinople" and hands him the paper. Maverick then sits down across from the Hamilton's, and the Colonel strikes up a conversation with him, intimating that he's an old friend of Cornelius's father. They agree to play a little poker later in "Bart's" private car. The conductor enters and whispers something in Bart's ear. After Bart leaves, McPherson gives Hakime a meaningful look, and Hakime exits the car. The Colonel then invites McPherson to join the poker game. McPherson reminds the Colonel they've played together before and the Colonel promises that the game will be "profitable."
Bart checks in with "Corny" back in the baggage car. The cactus is growing at a surprising rate, which Cornelius explains is due to the "dark and moist" environment. When Bart exits the car, he is pushed off of the train by an unknown assailant, and Cornelius pulls the emergency cord, telling the conductor that "Mr. Van Rensselaer" fell off the train. After Bart climbs back on board, he confronts "Corny" in private, wanting to know if there's something the heir is not telling him. Cornelius swears he knows nothing and tries to convince Bart that he must have simply lost his footing. Bart tells Cornelius that if it happens again, it's going to cost him more money.
Later, at the card game, Bart deliberately loses to the Colonel, Hakime and McPherson - silently letting the Colonel cheat. Since he's only losing "Corny's" money, and it's just "fake", forged checks at that, he figures why not let the Colonel have fun. Abigail, however, is upset and leaves the car to return to the public car, where Jeannie asks her what's wrong and invites Abigail to confide in her. Abigail instead flees to the baggage car, where Cornelius, posing as Bart's assistant, asks her if she's all right. The pair hit it off immediately. Abigail tells Cornelius that Bart is letting his poker partners take all his money, which certainly gets the heir's attention. Back in the private car, Bart departs after the conductor again whispers in his ear - after which, the Colonel and McPherson crow about how easily they took advantage of him.
Bart meets Cornelius back in the baggage car, where he is questioned about his losses. Bart explains that the bank will never cash the checks he's signed, because the signature isn't real, and he doesn't want to confront the Colonel: "Haven't got the heart, Junior. There's nothin' sadder than watchin' a card shark get old. Nimble fingers stiffen up, they get thick and clumsy. The Colonel was tryin' to deal seconds and they were comin' out from all over the deck." When Bart leaves the baggage car, he is again attacked by Hakime, but this time it's Hakime who gets thrown off of the train. Bart then returns to the baggage car to confront his employer. "Corny" finally confesses to the true situation: Hakime was working for a man named Hardman who is the head of a group of stockholders trying to take the railroad away from his father by preventing the heir from casting his vote at the meeting they are rushing to. He then offers to pay Maverick "anything" for his continued cooperation - which of course appeals to Bart. Meanwhile, McPherson and Jeannie have concluded that Hakime threw Bart off of the train. But when Maverick comes into the car and retrieves Hakime's newspaper, Jeannie concludes that "it's time to send in little old Jeannie McCabe."
Back in the private car, Jeannie and Bart are kissing when Bart notices that the train is slowing down. Stepping out to investigate, he falls off the stopped car onto the tracks. Jeannie comes out and Bart observes, "We're uncoupled." Back in the baggage car, Cornelius and Abigail are falling for each other. When Abby first notices that the private car is missing from the back of the train, Cornelius tries to tell her not to tell the conductor, but when she pulls the emergency cord anyway, he uses the unbalanced moment to kiss her. The train then backs up to reclaim the "lost" car - where Bart and Jeannie are once again happily kissing.
When she doesn't flirt with Bart, Colonel Hamilton complains to his daughter that she isn't pursuing her options properly: "Here you have a millionaire at your fingertips and you while away your time (with) some worthless no-account in the baggage car." Bart returns to the private car to find McPherson - who threatens to do him in. Jeannie enters, however, knocking McPherson off balance and enabling Bart to knock him out. She has a derringer and points it at Bart, but she's too attracted to him to use it. The conductor bursts in and Bart tells him that McPherson attacked him. McPherson is then taken away to be locked up in the baggage car. Once they're alone again, Bart and Jeannie agree she'll continue to "distract" him.
At the deserted train station, the conductor instructs everyone not to wander off while the train takes on water. Bart talks to "Corny," who announces he's in love with Abigail. Meanwhile, a mysterious shooter fires a "buffalo gun" at Bart and Cornelius, who are doused in milk but otherwise unharmed. "They can't hurt us," contends "Corny." Bart is not as confident: "You better keep your eye on the referee, because somebody's tryin' to kill me." Back on the train, Abby is trying to sell her father on her new-found love for the "baggage boy," who they still don't know is "the millionaire." Suddenly the train stops yet again. The conductor explains that the crew has run off because of "wild tales" about nearby "gold strikes." "Corny" startles Bart by claiming that "Mr. Van Rensselaer" can drive the train. The real Cornelius, of course, is able to drive the train. However, McPherson escapes, or is set loose, and knocks Cornelius unconscious, after which Bart pushes him off of the train. Corny remains unconscious, so Bart must drive the train. The train enters a tunnel and it looks like there's going to be a head-on collision with another train, but somehow they don't collide.
In St. Louis, the real Cornelius announces his intention to marry Abby. Bart, however, can't get "Corny" to leave the cactus, which has grown to gigantic proportions, and then they find themselves locked inside the baggage car with Burke, the train conductor, who holds them at gunpoint. Burke explains that he has been hired by Mr. Hartman to detain the heir until the voting closes at noon - ten minutes away. Bart quickly thinks of a ruse to get Burke to let Cornelius go. He accuses his "assistant" of also being in the employ of Hartman, a tale which Burke buys easily enough. The real Cornelius tells Burke that the conductor will get a $5,000 bonus for being the one who keeps Bart from the meeting and promises to go tell "their" boss about it. Cornelius takes the key from Burke, orders him not to resort to any "rough stuff," goes outside and gets in a carriage with Abigail. The carriage driver recognizes Cornelius, and both Abigail and her father are astonished to learn his true identity. The couple ride off in the carriage together, leaving the gleeful Colonel behind. Jeannie then enters the rail car, knocking the conductor off balance, causing him to lose his gun. Bart, however, gives him the gun back, since he doesn't care about the meeting, he only wants to cuddle with Jeannie. Cornelius and Abigail make the meeting just in time, and the son introduces his fiancé to his frazzled father. As it is now past noon, Burke thanks Bart for being so cooperative and departs. Of course, Bart and Jeannie begin kissing again as a nearby horse snickers in a very "human" way.