Shares of all five major publicly traded North American railroads reached all-time highs Tuesday as good news for the industry continues to roll in, this time from Canadian National (NYSE:CNI). This news has reaffirmed the positive tone set last week when East Coast rail operator CSX (NASDAQ:CSX) kicked off second-quarter earnings reports for the railroads, rebounding strongly from an unusually harsh winter and depressed first quarter to deliver record results.

Photo credit: Nate Beal via Wikimedia

If this headline sounds familiar, it should: Along with the other major North American freight railroads, over the past few years CSX has rebounded out of the recession into what might be it's strongest competitive position in history. The railroads already enjoy significant advantages in fuel and labor costs compared to their biggest competitors, trucking companies, and over the past few years they've made the most out of it, investing heavily in their own networks to reduce costs and capitalize on new opportunities.

Not two decades ago, coal made up nearly half of the railroads' total volume, but stricter environmental regulations combined with cheap natural gas have led many observers to predict the death of the coal business. This is likely true, in the long term, but more recently, higher natural gas prices have led to a slight improvement in coal shipments. CSX actually did see its coal volumes increase by 6% in the second quarter, but chronic weakness and poor pricing in the business led to lower revenue per coal unit. 

Yet coal is a decreasingly important part of the railroads' business. While railroads have historically relied on coal for volume, recently it is among the railroads' least profitable shipments per carloads. Ironically, the North American oil and gas boom that has led to the decline of coal has been, in its own way, a boon for the railroads. While CSX and Canadian National used to haul far more coal more profitably than today, now both companies find themselves shipping crude oil out of fracking fields and shipping raw inputs like sand into these same fields. As American and Canadian governments have dithered over the approval of pipelines, energy companies have had no choice but to turn to railroads to pick up the slack in meeting their transportation needs, to the advantage of railroads and their investors.

As international trade has picked up since the recession, so have the fortunes of every major North American railway. Apart from commodities, trade goods from overseas primarily come in the form of large metal intermodal containers that can easily be transported by ship, truck, or train. Over the past few years, trains have proven decisively that rail is the most cost-effective way to transport goods overland, and that has led to significant gains in market share for rail.

One important takeaway from the successes of CSX and Canadian National this quarter is that weather-related delays don't ultimately hurt the railroads in the long run. In the first quarter's extreme winter conditions, every railroad struggled with ice and cold causing service disruptions, with CSX blaming the weather for a 16% drop in operating income and Canadian National CEO Claude Mongeau claiming "the winter of a lifetime" had taken its toll on network capacity. But both companies turned in record second quarters largely on the back of essential freight like agricultural goods and crude oil. Customers from these categories had been complaining of back-ups from their rail providers all throughout the winter season, but it seems that as spring thaws arrived, these customers still believed rail was their best transportation option. This implies that so long as the railroads continue to invest in their networks, they will be able to outcompete trucking for long-distance freight service.

While railroads like CSX and Canadian National remain at a historically lofty valuation today, they remain persuasive investments. Operating as virtual monopolies within their territories, boasting virtually insurmountable barriers to entry and strong competitive advantages against trucking, railroads should prosper so long as the North American economy does. With dividends that have risen every year without fail for over a decade, a patient investor will be paid well to await the continuing rise of the railroad.