The booming shale oil production in the North America resulted in an oil glut in Cushing, Okla., the storage hub of the West Texas Intermediate crude oil. The reason for the glut was simple: Compared to the increasing amount of oil that was flowing in from producing fields, takeaway capacity of crude from Cushing to Gulf Coast and East Coast refineries was far too low.

The lack of takeaway capacity, particularly through pipelines, led to WTI being traded at an average discount of $20 per barrel when compared to the internationally quoted Brent benchmark. However, the best part is this: Refineries having ready access to the cheaper variant of crude oil enjoyed exceptionally good margins and stock appreciations.

This year, however, there's a similar situation brewing up north, across the border, which could have far greater consequences -- and also an opportunity for discerning investors.

The new oil glut
Western Canada's famed oil sands are pumping out more oil than ever. According to the Canadian Association of Petroleum Producers , Western Canada oil supply is forecasted to grow 19% this year from 2011 levels and an additional 7% in 2014 -- to 3.7 million barrels per day.

However, the takeaway capacity isn't sufficient. 

In simpler terms, the existing network of pipelines isn't just enough to transport the rising volumes of crude oil to refineries across North America. So bad has the situation become, pipeline major Enbridge (ENB -0.98%), the biggest transporter of Western Canadian  oil, is now urging production and refining companies to change their delivery and collection methods of crude oil in order to ease clogs and increase efficiency in its pipeline network.

The net result? Western Canadian Select, the local benchmark, is trading at a discount of $37  per barrel compared to the WTI. Which means, WCS is discounted to Brent by around a massive $55/barrel. Obviously, exploration and production companies operating in the sands are losing out on a substantial chunk of possible revenues. All simply because of a lack of takeaway capacity.

According to a Bloomberg report, investment bank PPHB Securities estimates that "Canadian companies are forgoing about C$2.5 billion a month because of the lower prices." Now that's a huge amount of revenue to lose every month.

How is it affecting companies?
Penn West Petroleum (NYSE: PWE) is tightening its purse strings and cutting down on expansion projects. The Calgary-based company  is just concentrating on its core projects in the Spearfish basin, which mostly produces light crude oil. Additionally, analysts are even expecting a likely cut in its generous dividend, which currently yields 10.4 %.

Similarly, Canadian Natural Resources (CNQ -0.03%) exports its production cheaply to the U.S. Midwest refineries and losing out on a lot of cash in the process. Not surprisingly, its stock has fallen almost 21% in the last 12 months. Integrated-oil Suncor Energy (SU -0.48%) is a little better off, since it has its own refineries to process most of the heavy, bituminous crude oil it produces .

The way out: pipeline on rails
Desperate to get the crude oil moving, Canadian producers in Alberta are increasingly relying on railroads to transport heavy crude to refineries in the U.S. Analysts estimate that crude oil transported by railroad in North America has shot up by 360,000  barrels per day in the last one year. This is equivalent to the capacity of a major pipeline!

My belief is that this trend will grow further. The western Canadian province of British Columbia has one of the most challenging terrains. It isn't easy to build a pipeline there. However, railroads already exist. And that's where opportunity lies. And my bet is on Canadian National Railway (CNI 0.12%).

Why I like this company
Canadian National is a specialist operator in the Alberta oil sands. No other railroad or pipeline company has a network as extensive as that of Canadian National's. It has trans-loading facilities in Saskatchewan, Edmonton, and three ports on the west coast. With 21,000 miles  of railroad crisscrossing North America, Canadian National has access to refineries across three coasts and ports for international shipping.

In the third quarter of 2012, Canadian National's year-over-year revenue  from petroleum and chemicals segment grew 15%. I believe the top line will grow further as oil production goes up. The company should see increased demand for its services. It's slowly making a foray into the Bakken formation as well, another area where takeaway capacity is struggling to meet with production levels.

A game changer?
According to the port authority at Prince Rupert, an oil terminal and a major port in the west coast, the rail line is still 75% empty . In other words, a surge in transportation volumes can be comfortably accommodated. The growth potential is huge.

Another reason why I'm bullish about railroads is because it's extremely difficult to get permits for new pipelines. Enbridge's 1,177-kilometer Northern  Gateway pipeline -- which aims to connect Alberta's oil sands to the Kitmat terminal in British Columbia -- is still well... in the pipeline. Currently, environmental issues are taking center stage with no guarantee of a green light ahead. Canadian National looks like a solid business to me, thanks to the oil glut in Canada.