It now looks increasingly likely that Barack Obama will reject the Keystone XL pipeline, with an announcement possibly coming during the Labour Day weekend.

Without a doubt, two interested observers will be Canada’s major rail companies, Canadian National Railway Company (TSX:CNR)(NYSE:CNI) and Canadian Pacific Railway Limited (TSX:CP)(NYSE:CP). Both companies have benefited from a shortage of pipeline infrastructure in Alberta’s oil sands, so a Keystone rejection would likely give them a boost. But how much of a benefit will these companies really get?

A slowdown

From the first quarter of 2012 to the third quarter of last year, Canadian crude oil exports by rail grew more than tenfold. We all know the reason: production from the oil sands was growing at a rapid clip, and pipeline capacity was unable to keep pace. Thus, rail was forced to make up the difference. Both CN and CP benefited tremendously.

Then in the first half of this year, the unexpected collapse in crude prices was accompanied by an increase in pipeline capacity. This caused differentials to drop, thus decreasing the incentive for Canadian oil companies to ship their product all the way to the U.S. Gulf Coast. Crude-by-rail shipments dropped by nearly 50% over just six months as a result.

What does the future hold?

A couple of pipelines went out of service in August, and this has caused differentials to widen slightly. This is giving some reprieve to the crude-by-rail industry.

But the long-term fundamentals for crude by rail are not good, even if Keystone is rejected. The drop in oil prices will have a serious impact on oil sands production long term, making today’s pipeline infrastructure look a lot more sufficient. Meanwhile, down in the United States, new pipelines run into far fewer roadblocks than Keystone did, so we should see more pipelines in the years ahead.

Making matters worse, the rails also must worry about the slowdown in China and what that does to commodity markets. Rounding out the threats, the decline in oil prices is making trucking more competitive on some shipments.

Should you still buy these companies’ shares?

These developments have not gone unnoticed by investors; in 2015, CN and CP shares have declined by 11% and 17%, respectively.

But CN still trades for 18 times earnings, and CP trades at over 20 times. On a free cash flow basis, these companies are even more expensive.

At this point, there’s very limited upside on either company’s share price. Your best bet is to look elsewhere.

Forget the rails: you should own this stock instead

Our analysts have identified this company as one TOP stock for 2015 and beyond. And you can download the name, ticker symbol, and price guidance absolutely FREE.

Simply click here to receive your Special FREE Report, "1 Top Stock for 2015 -- and Beyond."

NEW! This Stock Could Be Like Buying Amazon In 1997

For only the 5th time in over 14 years, Motley Fool co-founder David Gardner just issued a Buy Recommendation on this recent Canadian IPO.

Stock Advisor Canada’s Chief Investment Adviser, Iain Butler, also recommended this company back in March – and it’s already up a whopping 57%!

Enter your email address below to claim your copy of this brand new report, “Breakthrough IPO Receives Rare Endorsement.”

Fool contributor Benjamin Sinclair has no position in any stocks mentioned. David Gardner owns shares of Canadian National Railway. The Motley Fool owns shares of Canadian National Railway. Canadian National Railway is a recommendation of Stock Advisor Canada.