The price of the global oil benchmark, Brent, recently topped $82 a barrel, a four-year high. Oil companies that have access to the global marketplace are cashing in on crude prices these days.

However, not every barrel fetches Brent pricing, for a variety of issues. One of the biggest is the lack of infrastructure to transport or process the oil in a particular region. In the U.S., for example, the country's oil benchmark, West Texas intermediate (WTI), trades at a $10-per-barrel discount to Brent because of the lack of refining and export capacity, which is costing the U.S. oil industry $100 million per day. Meanwhile, in regions such as the Permian Basin and Western Canada, crude fetches as much as a $25 a barrel discount to WTI because of a lack of pipeline capacity. Those discounts have forced oil companies in those regions to start turning to railroads for help easing the pain at their pumps.

A closeup of an oil tank car focused on a hazardous material sign 1993 denoting flammable liquids.

Image source: Getty Images.

A gusher of growth in Canada

Canadian National Railway (CNI -0.67%) and Canadian Pacific (CP -0.61%) have been seeing an uptick in crude-by-rail volumes this year because of pipeline issues in their home country. Canadian National, for example, has transported 50% more oil by rail on a revenue-per-ton mile basis so far in the third quarter of 2018 than it did in the same period of last year. Meanwhile, Canadian Pacific's crude volumes rose 13% in the second quarter to about 134,000 barrels per day (BPD). 

Even higher amounts of crude will be heading on the rails in the coming months, with Canadian Pacific expecting its volumes to double by early 2019. One of the driving factors is that the country's pipeline crunch won't ease anytime soon, given the latest setback for the Trans Mountain Pipeline. With the court overturning that pipeline's approval, it has "added years to crude by rail," according to comments from Canadian National Railway's CFO at a recent conference. The company has been able to secure multi-year contracts "at very favorable rates," since Canadian oil producers desperately want better market access for their oil.

One of the oil companies that's turned to Canada's railways for help is Cenovus Energy (CVE -0.34%). The Canadian oil sands producer has been looking at ways of improving its market access because of the wide difference in oil prices. Cenovus noted in its second-quarter report that it was working with rail providers to resolve a shortage in locomotive capacity so that it can more fully realize the benefits of its Bruderheim crude-by-rail facility. That led Cenovus to sign a three-year deal with Canadian National to move volumes from that terminal, as well as a three-year contract with Canadian Pacific to ship oil from a third-party facility. Overall, the company expects to move 100,000 BPD at a per-barrel cost in the mid- to high teens. 

A line of oil tank cars.

Image source: Getty Images.

Helping ease the pain of the Permian Pipeline pinch

Producers in the U.S. have also been experiencing some pain at the oil pump. That's after capacity on pipelines out of the fast-growing Permian Basin started running out of room earlier this year, causing crude to sell for as much as an $18-per-barrel discount to WTI. Now oil shippers are turning to railroads for help.

Union Pacific (UNP -0.13%) is one of the companies working to capture this opportunity to ship oil out of the Basin. The railroad operator noted on its second-quarter call that it had some capacity to move Permian crude and should see results in the third and fourth quarters. Union Pacific has since signed a deal with a logistics company to ship 400,000 barrels of crude per month through the next year, which lines up with when new pipelines should enter service, though that agreement could last into 2020 if needed. More deals could follow as other producers seek ways to gain greater market access for Permian oil. 

Oil's pain is rail's gain

Oil companies in North America are growing production faster than the infrastructure can keep up, which is causing crude produced in some regions to sell at a deep discount to global prices. However, what's a problem for oil companies is turning into a great opportunity for railroads to fill in the gap. Several have signed lucrative contracts to ship oil, which should boost their earnings until new pipelines come online. For now, rail stocks have a bit more fuel to drive earnings growth, which could be their ticket to outperforming the market in the next few years.