North America's first transcontinental railroad, Union Pacific, (NYSE:UNP) reported earnings on Thursday and, after 150 years, this freight carrier is still chugging along nicely. In a business environment in which other railroads have slashed their earnings outlooks due to fears over plummeting coal volumes, Union Pacific delivered the best quarter in the company's long history. Big gains in two sectors in particular helped the company outperform, and the best news for investors is that these improvements are not only sustainable over the long term, they're still growing.

Safer, cheaper, faster
Union Pacific wasn't immune to the secular decline in coal, and coal shipments did decrease by 12%, with coal revenue falling 5%. However, the strong operational performance allowed Union Pacific to persevere, delivering an 18% growth in revenue. Profit topped $1 billion, a 15% gain from 2011. Core pricing increases of 5% offset flat volumes, while good operation control over expenses resulted in the best operating ratio of the company's history, at 66.6%. Quarterly earnings of $2.19 per share were slightly above analyst estimates.

In their conference call Thursday, management credited the excellent operating ratio to improvements in safety, as well as disciplined capital investment. Vice President of Operations Larry Fritzer announced that new training and incentive programs resulted in the best employee safety record in the company's history, as well as a lower incidence of damaged equipment. Thanks to investments in trackage and equipment, Union Pacific's network also saw faster trains, longer trains, and fewer delays, all helping to reduce costs.

Show me the money!
While an improved operation structure is impressive, the big story Thursday was that Union Pacific was actually able to grow revenue at all in the face of a 12% decrease in coal volumes. Rail investors have been alarmed about slowing coal shipments since fellow Class I carrier Norfolk Southern (NYSE:NSC), which operates in the Eastern U.S. and has significant exposure to Appalachian coal, gave very grim earnings guidance in September, blaming a terminal decline in coal. These fears were calmed somewhat this week, when another Eastern railroad, CSX (NASDAQ:CSX) released its own earnings. Coal was down at CSX, as well, but stronger volumes of intermodal freight, the standardized cargo containers that can easily be moved between cargo ships, trains, and trucks, helped the freight carrier to end relatively flat.

Intermodal is one of the two big stories at Union Pacific, as well. Though volume increased only 1%, stronger core pricing saw intermodal revenue rise 8%, to $1.02 billion. This gain leaves intermodal traffic, already Union Pacific's second most valuable freight category, only $36 million behind coal in terms of revenue. This is perhaps the #1 area that rail investors need to watch. Railroads compete primarily with trucks for intermodal business, and they seem to be winning. Steel-wheel-on-steel-rail technology is inherently more energy efficient than rubber tires on asphalt and, due to the size and length of trains, labor costs are lower relative to trucks, as well.

Rail's gains might just be getting started. In an investor conference in September, parcel delivery giant FedEx (NYSE:FDX) announced a host of cost-cutting measures designed to combat what it saw as prolonged softness in its express delivery service. FedEx, which runs a fleet of airplanes, trucks, and delivery vans, specifically blamed shifting consumer preference, as more people opted for slower, less expensive delivery options, like rail. As customers look to reduce unnecessary expenses, rail's value proposition is ever more attractive.

Union Pacific is directly benefiting from converting truckload intermodal shipments to rail shipments. In the third quarter, Union Pacific moved about 850,000 intermodal carloads. Vice President of Sales Eric Butler estimated that the addressable market for highway-to-rail conversion, taking into account intermodal highway volumes within a reasonable radius of Union Pacific's existing network, was between 3 and 4 million carloads. Not only could the company benefit from greater volumes, but management believes there's also room for better profit margins. Currently, Union Pacific prices intermodal freight at a 30% discount to trucking companies, and CEO Jack Koraleski sees a lot of opportunity in narrowing that gap.

Fracking: Friend or foe?
It's conventional wisdom that the new hydrofracturing techniques that allow exploitation of cheap natural gas has hurt railroads by making coal less attractive. But this "conventional wisdom" doesn't tell the whole story. In fact, fracking is the second reason that railroads might just continue to outperform for years.

Not only do railroads ship the fracking sand and construction equipment that producers need to perform hydrofracturing, but the process has also made crude oil production possible in places it never was before, such as in the Bakken shale formation in North Dakota. Without pipelines in place, oil producers in North America's interior have had no choice but to ship crude oil by rail. This trend has seen record increases in Union Pacific's chemical volumes, as a 95% increase in petroleum products led chemical revenues up 17%.

While pipelines under construction eventually will make certain routes unprofitable for rail, Union Pacific sees pipeline activity as something that will merely slow the increase in oil volumes, not stop or decrease it. The company believes that the flexibility offered by rail is a serious value proposition, and expects chemical shipments to be a more important mix of revenue going forward.

Fool contributor Daniel Ferry has no positions in the stocks mentioned above. The Motley Fool has no positions in the stocks mentioned above. Motley Fool newsletter services recommend FedEx. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.