A proven way to build long-term wealth is to seek out top-quality companies in beaten-down sectors, then hold them as their industries rebound.

Take railways, which find themselves in an uphill pull, thanks to the plunge in oil prices, which has slashed crude-by-rail shipments; the higher dollar, which has weighed on exports; and tough environmental regulations, which are kneecapping coal demand.

The effects were shown in fourth-quarter results from Union Pacific, which experienced revenue drops ranging from 7% to 31% in five of its six main shipping categories. The sole exception was automotive, which eked out a 1% gain.

But in cyclical businesses such as railways, one thing always rings true: Better days will eventually return. Meanwhile, these down periods are a good time for investors to make winning trades by picking up strong operators at attractive prices.

Enter Canadian Pacific Railway (CP) , which has 14,000 miles of track running from Vancouver, in Canada's west, to Montreal in the east and stretching down to major U.S. hubs such as Chicago, New York and Philadelphia.

For the past six months, the company has been focused on its $25 billion bid for Norfolk Southern. That deal would have created North America's biggest railway and given Canadian Pacific better access to busy ports in the Gulf of Mexico and along the Atlantic coast.

But Canadian Pacific walked away from the bid on April 11, after everyone from the U.S. military to FedEx and United Parcel Service came out against it, mostly over concerns that it would lead to poorer service and higher prices.

On the surface, that looks like bad news. But sometimes a failed takeover can be just the tonic a company needs to refocus on what it does best, and in Canadian Pacific's case, that is improving its efficiency and putting cash into investors' pockets.

When judging a railway stock, pay close attention to the operating ratio, which compares operating costs with revenue. The lower the ratio, the more efficient the railway.

For all of 2015, Canadian Pacific's operating ratio clocked in at 61%, and the company thinks that it can push that down below 59% this year.

That makes Canadian Pacific more efficient than CSX, at 72%; Norfolk Southern, at 74.5%; and Union Pacific, at 64%. In fact, the only operator left for Canadian Pacific to reel in is chief rival Canadian National Railway, the most efficient railway on the continent, at 57%.

That efficiency focus is paying off in higher profits, a rarity in railroads these days.

The average analyst estimate calls for a 6.6% rise in earnings per share when Canadian Pacific reports first-quarter results on Wednesday, despite a forecast for a 3% revenue decline. Compare that with Union Pacific, which is expected to post a 15% drop in earnings per share, and CSX, with a projected 13% decline.

And don't bet against Canadian Pacific surprising to the upside. The company has topped the consensus EPS forecast in each of the past four quarters by as much as 4.5%.

Now that its Norfolk Southern bid is off the table, Canadian Pacific will likely undertake a significant share buyback, helping increase earnings per share going forward because buybacks cut the number of shares outstanding. That would come on top of the $2.75 billion (Canadian) the company spent on repurchases last year.

The stock's forward price-to-earnings ratio is 12, below chief competitor Canadian National, and the stock trades at about $147. The median 12-month price target doesn't call for much upside, but the high end of the range is $164, which would represent a gain of about 11%.

That is entirely realistic, thanks to a likely buyback boost and the improving Canadian economy, which posted better-than-expected gross domestic product growth in January.

So don't wait. Climb aboard Canadian Pacific now.

"Give me nine minutes a week, and I guarantee you $67,548 a year." An 85% accurate trader gives his personal guarantee. He turned $50,000 into $5 million trading this way and for a limited time, he is guaranteeing investors at least $67,548 per year in profitable trades if they follow this simple step-by-step process. Click here to see how easy it is to collect thousands of dollars in "free money" every month.

This article is commentary by an independent contributor. At the time of publication, the author held no positions in the stocks mentioned.