It’s time for this railroad’s board to punch its ticket.

Kansas City Southern, the smallest major freight railroad in the U.S., has been the subject of a bidding war between two Canadian rivals. Its shares fell Tuesday because of an unwelcome regulatory decision, but things turned out nearly as well as they could have for its shareholders.

Having agreed in March to be bought by Canadian Pacific Railway Ltd. , it switched to a higher bid containing more cash by that company’s larger domestic rival, Canadian National Railway Co. It then stuck with Canadian National after receiving a counteroffer from its original suitor earlier this month while shrewdly delaying its shareholder vote until this Friday.

A decision Tuesday by the U.S. Surface Transportation Board not to approve the voting trust that Canadian National was to use to purchase the shares makes its next decision obvious: KCS should snap up the $1 billion break fee it is now owed by Canadian National and go back to its original suitor with its improved bid. Canadian Pacific applied under a more lenient set of rules and already has had its voting trust approved by the STB. While that doesn’t guarantee that the agency will ultimately give the green light to an eventual merger, KCS’s shareholders can still get paid while the bureaucrats dither.

In theory Canadian National can appeal the STB’s decision or even proceed without a voting trust and further sweeten its offer, but KCS’s shareholders would be foolish to take that risk, which would be the equivalent of exchanging a bird in the hand for 1.1 in the bush. Without a trust, the only financial surety it can get is yet another break fee. And the STB’s unanimous decision not to approve the trust, along with tougher talk in general from the Biden administration on competition matters, makes a deal a long shot without serious concessions.

Canadian Pacific’s decision to raise its original bid, meanwhile, might have been unnecessarily aggressive since it wasn’t financially superior to the existing offer. The new offer may have convinced KCS to delay the shareholder vote on Canadian National’s bid but, given the STB’s decision, Canadian Pacific could have eventually walked away with its prize anyway, and for billions less. Its shares fell 4.5% on Tuesday. Its rival’s stock, meanwhile, jumped 7.3% despite being on the hook for $1 billion. If the STB had approved the trust but later rejected the merger itself, Canadian National would have been a forced seller of KCS shares for a potential loss of billions more.

It has been quite a ride, but KCS’s shareholders have come far enough. Why risk waiting to see what lies around the next bend?

Write to Spencer Jakab at spencer.jakab@wsj.com