Progress's marshal Flagg Robert Mitchum senses trouble when his arch-rival, Big John McKay George Kennedy, is headed toward town. He wastes no time warning Mayor Wilker Martin Balsam and others about rumors of an impending train robbery, a warning that irritates the mayor who wants to keep a calm public image and quickly relieves Flagg of his badge. With his authority stripped, Flagg sets out on his own, determined to uncover the truth.
He soon discovers that McKay has assembled a gang of youthful outlaws, and after Flagg is captured, he narrowly escapes death thanks to McKay’s intervention when the gang’s young leader, Waco David Carradine, takes control. The old enemies collide again in a brutal fistfight, a clash that underscores how the past clings to the town even as it edges toward a new era. Flagg is brought back to Progress and placed in a boarding house run by Mary Lois Nettleton, a widow who provides a quiet, stabilizing presence in the midst of rising chaos.
The townspeople, slow to take the threat seriously, are blindsided when the outlaws ride in with plans to rob a train. In a surprising turn, McKay sides with Flagg to thwart the heist, revealing a complex bond between the two men that goes beyond rivalry. Grundy Douglas Fowley, a once-trusted ally of Flagg, plays the fool and ends up fatally shot in the back by Deuce John Davis Chandler, one of the gang members, highlighting the peril that surrounds them all.
The plan unfolds as the outlaws aim to rob the train before it reaches the town bank, slipping past the station and onto the tracks. Flagg and McKay board the locomotive just ahead of the others, initially getting detained by onboard security inside a privy, but they manage to break free. They seize the opportunity, climbing into the engine cab and taking the crew hostage. The train never stops at the station; it rattles straight into town, carrying the momentum of the confrontation with it.
Mayor Wilker and a determined group of townsfolk chase after the speeding train, while the outlaws press their pursuit from behind. McKay expertly uncouples the front cars from the rear passenger coaches, gaining a precarious advantage and outrunning his pursuers. The chase culminates at a perilous stretch where the track runs over a cliff; the train is moving too fast to stop, and Flagg, McKay, and the workers leap clear just as the cars plummet and explode in a blaze of fire and debris.
In the aftermath, the outlaws scramble to salvage what they can from the burning wreckage. Flagg and McKay stage a decisive ambush, killing most of the gang in a tense gunfight. A crucial encounter with Waco—who is about to escape—ends with McKay wounding him, and then McKay delivering the fatal shot. As the two men stand over the fallen Waco, McKay murmurs, "I thought I could beat him [Waco]," and Flagg responds with a quiet acknowledgment, "You did beat him."
Back in Progress, Wilker expresses gratitude for the two men who saved his town and, with his reputation on the line, even muses aloud about a future run for higher office. McKay’s later remark—suggesting that Wilker could become president one day—echoes the town’s shifting ambitions and the uneasy blend of heroism and politics that have shaped Progress.
Later, the new town marshal offers Flagg his badge back, a gesture he rejects, choosing instead to impart one last piece of hard-won wisdom: to succeed, you must learn to tell the good guys from the bad guys. The film closes with a final, ironic moment as Flagg arrests McKay and handcuffs him, despite McKay’s protests. In a nod to their complicated history, Flagg reminds the audience that he will always keep his word, recalling a promise to land McKay in jail. The scene settles into a wry, unresolved balance between respect, rivalry, and the costs of justice in a town where old loyalties linger and new power struggles take shape.