What happened

Union Pacific's (UNP -1.82%) first-quarter earnings report showed the company is on track, despite some evidence of a slowing economy. Investors were pleased with its results, sending shares of the railroad giant up as much as 3%. As of 12:24 p.m. ET, the stock had settled to a 0.4% gain.

So what

Union Pacific earned $2.67 per share on revenue of $6.1 billion, beating analysts' expectations for earnings of $2.59 per share on sales of $6.07 billion.

The headline numbers were fine, but the underlying trends behind them provided some reason for caution. Overall business volume was down about 1% year over year, with bulk volumes including transport of coal and grains declining 3% and intermodal shipments slumping 1%.

Bad weather had an impact on volumes, but the results could also be read as a sign that economic activity is slowing. Union Pacific's operating ratio, a measure comparing revenue to expenses, fell by 270 basis points to 62.1%.

"In addition to the impact of weather on carload volumes and costs, higher inflation also reduced our operating income and more than offset our record first quarter operating revenue," CEO Lance Fritz said in a statement. "Despite a continued challenging environment, our strengthening service product, bolstered by a strong pipeline of new employees, gives us confidence we can capture available demand and improve efficiency the remainder of the year."

Now what

Railroads and other transportation stocks tend to be cyclical. There is only so much a railroad can do to keep revenue growing if the economy falters and demand wanes. For investors, the key thing to watch is how well a company is able to respond to difficult conditions.

On this measure, Union Pacific looks pretty good. The railroad maintained its full-year 2023 guidance and stuck by its long-term plan to pay out about 45% of earnings as dividends and put excess cash toward share repurchases. There is little in the earnings report to suggest that this railroad won't keep chugging along.