Earnings per share beat Wall Street analyst expectations of $2.35, with better-than-expected earnings attributed to higher pricing and an improvement in operating ratio of 65.7%.
UP revenue rose 5% to $5.47 billion, slightly below expectations.
Just before noon Thursday, shares of UP were up 1.1% on the New York Stock Exchange.
Union Pacific CEO Jack Koraleski expressed cautious optimism, saying, "As we move into the second half of the year, the economic outlook remains uncertain, but we're hopeful that we'll see some economic improvement in the months ahead."
UP noted coal volume during the quarter was roughly equivalent to the 2012 second quarter, indicating that the steep decline in coal volume may be tapering off. That decline contributed to a falloff of 1% in the number of carloads UP counted during the second quarter.
Agricultural products and intermodal containers also saw declines, UP said, while other categories grew.