Size isn't everything. Union Pacific (NYSE:UNP) is the third-largest North American railroad by market cap, but it's not good enough for me to consider it even the third-best railroad company. Luckily, Union Pacific happens to be in the right business at the right time -- a strong market for rail transport has improved the performance of even this company.

Revenue rose 10% in the second quarter, with commodity revenue accounting for virtually all of that. While volume increased only 1%, pricing and fuel surcharge recoveries improved more significantly. Union Pacific also managed to improve its operating efficiency. Its operating margin climbed more than two points to 14% for the quarter -- an improvement, yes, but still far off the levels of rivals.

With better revenue and operating efficiency, Union Pacific managed to achieve 30% growth in operating income -- the first year-over-year improvement in that category in six quarters. Although the company is also generating more cash flow, much of that is being gobbled up by higher capital spending.

Looking at the types of goods shipped, there were few major surprises. In terms of revenue, industrial products grew 19%, agriculture grew 16%, and intermodal grew 10%. While Union Pacific actually shipped 3% fewer carloads of automobiles, revenue from automobile shipments actually increased 1%. It is also worth noting that the company missed out on roughly $0.09 of earnings from coal shipments due to various problems in the Powder River Basin area in Wyoming.

I'm not looking to kill Union Pacific here, but in my mind this is a consummate example of how great business conditions can improve the fortunes of even the underachievers. With demand for rail transport running ahead of capacity, these are the good times for railroad companies.

Clearly I'm not a fan of Union Pacific. I've written in the past of my fondness for Genesee &Wyoming (NYSE:GWR) and Canadian National (NYSE:CNI) and I'd much prefer to own either of those before Union Pacific. Other railroads like CSX (NYSE:CSX) and NorfolkSouthern (NYSE:NSC) might also be worth a look.

Kudos to Union Pacific on a good quarter, but it still has a long way to go before I'd want to own the stock for a long haul.

More Foolish Takes on the railroads are in the station:

Fool contributor Stephen Simpson has no financial interest in any stocks mentioned (that means he's neither long nor short the shares).