Shares of Union Pacific (NYSE: UNP) hit a 52-week high today. Let's take a look at how it got there and see if clear skies are still in the forecast.

How it got here
Although it might seem counterintuitive, trains are considerably more fuel efficient than trucks at transporting freight. Yes, trains require large amounts of fuel to move tons of goods a single mile, but with high oil prices, they are a logical, timely, and efficient source to transport materials.

The biggest boost in recent weeks for many of the nation's largest railroads, including Union Pacific, has been ratings agency upgrades with regard to their credit. Union Pacific and Kansas City Southern (NYSE: KSU) have both received credit upgrades while CSX (NYSE: CSX) had its outlook revised to positive. This is important because railroad companies rely on debt to fuel infrastructure growth, and refinancing or taking out new loans at cheaper terms could save each of them hundreds of millions of dollars. In May, Union Pacific announced its intentions to invest $3.6 billion in fiscal 2012 on growth initiatives and maintenance.

There's another side to this story, however, and it runs straight through the heart of coal country. The decline in natural gas prices has coerced numerous electric utilities to switch to the cleaner-burning fuel at the coal companies' expense. Fewer coal shipments have resulted in reduced shipping volumes for railroad companies. April coal shipments declined by a whopping 16.6%, the largest decrease on record, according to the American Association of Railroads. Despite this downturn, however, American Railcar Industries (Nasdaq: ARII), a manufacturer of railcars, reported a record shipment of railcars in the first quarter. Investors should stay focused on significant movements in these numbers to understand whether coal will continue to weigh on the railroad industry.

How it stacks up
Let's see how Union Pacific stacks up next to its peers.

UNP Chart

UNP data by YCharts

Since midway through 2011, Union Pacific has really pulled away from the pack with Norfolk Southern (NYSE: NSC) bringing up the rear with a very respectable 29% gain over five years.

Company

Price/Book

Price/Cash Flow

Forward P/E

Debt/Equity

Union Pacific 3.0 9.6 12.7 47%
Kansas City Southern 2.8 11.9 16.9 52%
CSX 2.8 7.1 11.0 107%
Norfolk Southern 2.4 6.7 10.8 83%

Source: Morningstar, Yahoo! Finance.

The primary difference between these railroads tends to be their reliance on debt relative to cash and equity on hand. CSX and Norfolk Southern carry the most debt relative to company equity, yet also are valued at a moderate discount to Union Pacific and Kansas City Southern relative to cash flow and forward P/E. CSX and Norfolk are also the most reliant on revenue from coal shipments relative to Union Pacific and Kansas City Southern.

Another factor to consider here is the quality of the debt itself. While ratings agencies seem to be scrambling as quickly as they can to up railroading companies' ratings, Kansas City Southern remains the only major railroad with a credit rating below investment grade (albeit just one notch below). That added weight on the company's shoulders could hinder it from saving hundreds of millions in lower interest rates. That, in turn, could lead to it being outspent by its rivals and put it at a marked disadvantage to its peers.

Another factor to keep an eye on is dividend growth. Norfolk Southern actually leads the charge with a 2.7% yield with CSX close behind at 2.5%. Union Pacific's yield is only 2%, but considering its quarterly payout is up 500% in just the past decade and it has outperformed its peers, I'll cut it a break. Again, Kansas City Southern is bringing up the rear with a 1.1% yield.

What's next
Now for the $64,000 question: What's next for Union Pacific? That question depends on whether coal demand picks up in the coming months, whether consumer demand remains high, and whether fuel prices remain high. The former will drive higher volume traffic while the latter will give railroads a competitive per-ton edge over shipping freight by truck.

Our very own CAPS community gives the company a highly coveted five-star rating, with a whopping 96.5% of members expecting it to outperform. This is one case where I'm happy to consider myself among the majority with my outperform CAPScall currently up 12 points.

With no plans to close that selection anytime soon, I'll be looking for Union Pacific to use its superior leveraging power to out-build its rivals and maintain significant pricing power -- even with beaten down coal companies. Since 2004, Union Pacific's operating margin has improved each and every year from 10.6% to slightly more than 30% based on its trailing-12-month results. This shows Union Pacific's commitment to curbing costs and maximizing profits, which ultimately puts more money into shareholders' pockets in the form of higher dividends and an increased share price.

If the rising cost of fuel has you down, then maybe you should consider looking at three companies our team at Stock Advisor feels will outperform when oil prices rise. Find out the identity of these stocks for free by clicking here to download your copy of our latest special report.

Craving more input on Union Pacific? Start by adding it to your free and personalized Watchlist. It's a free service from The Motley Fool to keep you up to date on the stocks you care about most.