Union Pacific (UNP 1.12%) managed to grow net income in a flat revenue environment, and investors are taking notice. Shares of the railroad company are up 5% as of 2:45 p.m. ET after Union Pacific topped earnings expectations.

Progress in a "challenging" market

Union Pacific earned $2.69 per share in the first quarter on revenue of $6.03 billion, ahead of Wall Street's $2.52 per share on sales of $5.98 billion guidance. Operating income was up 3% year over year even as total revenue fell slightly, as lower fuel and equipment costs offset higher compensation and benefit expenses.

"Our team delivered strong financial results in the first quarter as we navigated a challenging freight market and normal winter conditions," CEO Jim Vena said in a statement. "These results build on the momentum we established as we exited 2023 and provide further proof of what's possible as we strive to be the best in safety, service, and operational excellence."

Vena took over as CEO last August after large investors forced the ouster of former CEO Lance Fritz. The new CEO has a reputation for cost cutting, and Wall Street was eager to see progress during this earnings season.

Union Pacific said workforce productivity improved 1% year over year, and freight car velocity was up 4%. The company's operating ratio, a closely watched measure of efficiency, improved by 140 basis points to 60.7%.

Is Union Pacific a buy following its earnings beat?

Union Pacific enjoys a duopoly with Berkshire Hathaway-owned BNSF Railway over U.S. West Coast ports and has a network of track throughout the western half of the country. The entire transportation industry has seen demand for services fall over the past year due to broader macroeconomic concerns, but UNP appears to be making good progress on costs.

Even with Thursday's gains, the shares are down for the year, and Union Pacific has underperformed the market for the last five years. Vena still has a lot of work to do, but for patient investors looking to buy in ahead of a rebound in demand, Union Pacific appears to be on the right track.