Railroad president Amos Skinner and Wells Fargo Agent Tim Hardesty are riding a handcar down the tracks, looking for the train that left Whipsaw...and then disappeared into thin air.
A day earlier, Bart is having lunch with Modesty Blaine at the Whipsaw Steak House. She shows him her new engagement ring and he warns her that she's not the marrying type. Melody says that she wants to settle down and her fiancé is just the man to provide for her. Bart refuses to let her throw her life away and Modesty immediately seizes on his offer. She kisses him but then slaps him as the town deputy, Leroy Hoad, comes in. When he comes over, Modesty claims that she's never seen Bart before. Hoad warns Bart that he's kissing another man's fiancée and hauls him off to see the other man. As they leave, Doc Holliday comes in. Bart appeals to him for help but Doc says that there's nothing he can do.
Modesty's fiancé, Skinner, is meeting with Diamond Jim Brady and Montague Sprague. The two men are rival train manufacturers and Skinner owns the local restaurant. Brady offers to beat the time of Sprague's best engine by four hours if in return Skinner buys trains from him. Skinner agrees and Sprague protests and Brady offers him a $10,000 wager. He taunts Sprague into accepting and the two men leave. Hoad brings Bart in and explains that the gambler took him for all of his money in a "friendly" game of poker. Skinner isn't impressed but becomes angry when Hoad explains that Bart was kissing Modesty. He tells Bart to be out of the state by midnight and tells Hoad to put Bart on Brady's train. When Hoad warns that Bart will try something, Skinner tells him to escort Bart out of the state personally. Bart threatens to go to the governor and Skinner tells him to try: the governor is his brother.
At the saloon, Sprague goes to see Doc. He wants assurances that Doc has arranged for the delay of Brady's train and Doc assures him that everything is set.
At the train station, Modesty continues pretending she doesn't know Bart. Sprague and Brady are there to admire Brady's new train and Sprague asks where their money will be held. Skinner offers to put it in his impenetrable safe in the baggage cart and tells them that he's transporting $100,000 for the U.S. Treasury. Modesty, who knows all about it, reminds him that it's supposed to be a secret. Meanwhile, Hoad buys a two-way ticket to Denver for himself and a one-way ticket for Bart.
Skinner takes the $20,000 wager money to his safe. As he opens the lock using numbers he's written down, Modesty confirms that the $100,000 is inside. Once her fiancé closes the door, Modesty kisses him and steals the note with the safe combination and says that she'll meet him later for dinner. As she leaves, Skinner suggests that Brady and Sprague take the train to Denver and he'll wire his agent to pay the $20,000 to the winner upon arrival.
As Brady and Sprague board the train they run into Bart. Brady is an old friend of the Maverick family and suggests that they play poker. Hoad refuses to let Bart out of his sight but Doc steps in and strongly suggests they could use a game of poker. When Hoad realizes that he's talking to the legendary Doc Holliday he quickly backs down. Brady takes responsibility for Bart and invites Sprague to play. The businessman refuses and stays back. As Doc goes, Sprague tells him to put his plan in motion to delay the train. Doc assures him that his plan is in motion and that there will be a five-hour delay. They are both unaware that Modesty is listening to their conversation.
Bart, Brady, and Doc go to the dining car to play poker as the train leaves. Bart explains his situation and Brady assures him that the train will make the state border by midnight. A veiled Modesty goes past them to the baggage car, uses the combination she stole to open the safe, and takes the treasury money. As she goes back through the dining car, she slips as the train hits a rough spot and falls on the card table. Bart almost recognizes her and then goes to his bag to get a new deck of cards. He finds the cards...and $100,000. When he sees Modesty watching him, he realizes who she is and sits down next to her. After toying with her for a bit, he removes her veil and asks what she's doing. Modesty explains that the money belongs to the U.S. Government and she hid it in Bart's bag so they wouldn't find it when the train stops. When he wonders why the train would stop, she explains that she overheard Doc explaining his plan to Sprague. Modesty figures that she and Bart can escape together when the train stops but he angrily refuses to get involved and leaves.
Down the tracks, Doc's hired man, gentleman criminal Justin Radcliffe, is initiating their plan. He has his men open a track switch and then uses it to send the train down a side spur. The engineers only realize something is wrong when they find themselves deep in the woods. Radcliffe's men remove the switch to cover their tracks and follow the stalled train. When Brady and Doc come out, Radcliffe and his man Rufe take Brady prisoner and warn him that they're robbers.
The passengers wait for the train to start and Hoad finds Bart with Modesty again. He figures that Bart convinced Modesty to run out with him. Before Bart can correct him, Radcliffe's men enter the carriage and capture the passengers. Outside, Radcliffe suggests that Doc hand over his gun to make the charade convincing. Doc refuses, warning that he can shoot the thief before he can draw. However, he agrees to hide his gun beneath his jacket. Radcliffe then enters the carriage and politely tells the passengers that he's a master criminal who recently left prison. The thief boasts that the bigger the crime the more likely the chance of success and acknowledges that he has stolen an entire train. He goes to crack the safe in the baggage car and Bart tries to come up with a plan. Finally he approaches Brady, who realizes that they're near the Golden Eagle Mine. Bart admits that Pappy used to sell shares in the mine after the vein went dry and starts to get an idea. He suggests that Brady pay him $10,000 if he can help him win the bet and Brady agrees.
Skinner gets word that the train didn't make the next station, and contacts Hardesty. They go down the tracks on a handcar to find the missing train.
Bart asks Doc what's going on, based on what Modesty told him about Doc's plan. The gambler explains that Modesty stole the treasure money and warns that she's not as innocent as she appears.
Radcliffe easily opens the safe but discovers that there's no money. He figures that Skinner set the train up as a decoy while he sent the treasury money elsewhere and has to acknowledge the millionaire's cleverness. Radcliffe figures that they're best off taking Holliday's $2,000 payment for stopping the train and leaving before the authorities arrive.
Bart tosses his bag with the money out the window. Radcliffe comes in and admits that he's failed and the safe was empty when he found it. Sprague demands to know where his $10,000 is and says that he saw the treasury money in the safe earlier and Radcliffe realizes that he's been tricked. He has Rufe and the others take the passengers outside while they search the train for the money. As they go outside, Bart trips a passenger and slips away during the distraction. He takes the money and goes to the baggage car, unaware that Modesty is secretly following him.
Doc and Brady talk quietly and they hear the bell on the handcar. However, they figure that no one will spot the side spur and locate them.
Bart puts the money back in the safe and closes the door. However, Rufe finds him and takes him to the others. Once they leave, Modesty enters the baggage car and uses the combination to open the safe and steal the money again.
Brady suggests to Doc that they try to sound the train whistle and alert the search party. When Doc refuses, Brady points out that he has a hidden gun and figures that he set the whole thing up with Radcliffe. When the businessman warns that Bart could get hurt, Doc assures him that he'll take care of his friend. Rufe brings Bart back and Radcliffe demands answers. The gambler explains that he put the money in the safe and Radcliffe goes to get it. Doc slips away and finds Modesty with the money in her bag. She tries to seduce him but soon realizes that he's armed.
Radcliffe discovers that the safe is empty again and goes back to confront Bart. Bart has no idea what is going on but the thief doesn't believe him. Radcliffe has his men prepare to string Bart up to force him to reveal where the money is. Meanwhile, Doc and Modesty enter the train cab and sound the whistle. When Rufe and the others open fire, Doc returns fire while Modesty works the controls.
Skinner and Hardesty hear the whistle. Hardesty suggests that it's in the forest but Skinner says that's impossible and they continue on.
Modesty manages to start the train, knocking off two of Radcliffe's men as they try to climb aboard. Radcliffe goes after Doc and Modesty hits him over the head with a board. Brady frees Bart, who has discovered a sign identifying the mine and Hoad knocks out Radcliffe for good.
Back in the carriage, Doc takes the money from Modesty. Sprague tries to collect his money but Bart stops him and explains that the Golden Eagle Mine was incorporated in Nebraska. When Radcliffe took the train off on the side spur, he brought it over the border into Nebraska. Since the arrangement was that the train would cross into Nebraska by midnight, Brady wins the bet and the manufacturing contract with Skinner. The mine sign confirms that the Golden Eagle Mine is in Nebraska. Bart notes that it's midnight and he's out of the state so Hoad can let him go. The deputy agrees but says that he can't let Bart come back on the train into Kansas. Brady has to side with Hoad but cheerfully pays Bart his $10,000 and wishes him well as the gambler is forced to walk to Denver.
As Bart walks down the tracks, Doc and Modesty approach him and claim that they came to him out of guilt for getting him into the whole mess. Bart figures that they're more interested in his newly-acquired $10,000 and they admit that might have played a part in their decision as they walk down the tracks together.