Image source: CSX.

The railroad industry has been hit hard by the weakness in commodity markets in recent years, and the decline in energy prices has proved especially difficult for CSX (CSX -1.95%). The railroad giant has historically been more reliant on shipping coal than many of its peers, and coming into Wednesday's second-quarter financial report, CSX investors had expected both revenue and earnings to take a double-digit percentage hit. The railroad wasn't able to avoid that fate, but the company's results weren't as bad as many had feared. The response was immediate, and the fact that CSX unexpectedly released its results during the trading day gave investors a chance to react. Let's take a closer look at how CSX did and what it sees in the future.

CSX keeps chugging along

CSX's second-quarter report once again confirmed the trends that we've seen for several quarters from the railroad. Revenue was down 12% to $2.7 billion, but that was still slightly better than investors had expected to see from CSX. Net income fell by a fifth to $445 million, but the resulting earnings of $0.47 per share were $0.03 higher than the consensus forecast among those following the stock.

A closer look at CSX's financials tells a similar story to what we've seen recently. Overall volumes were down 9%, and a decline in fuel surcharges by nearly three-quarters was also responsible for a large part of the decline in revenue. The railroad's operating ratio, for which lower values are better, jumped more than two percentage points to 68.9%, reflecting the decline in operating income relative to revenue. The company pointed to the low commodity prices, the transition in the energy market, and the strong U.S. dollar as ongoing headwinds.

CSX's various segments were mostly weaker, but there were a few bright spots. Minerals shipments jumped 13%, and automotive volume eked out a 1% gain. However, a drop of 34% in coal volume for the quarter weighed on the entire company, and a double-digit decline in chemicals shipments also had a large impact on overall volume. Agricultural products, phosphates and fertilizers, metals, and forest products also suffered declines in volume of 8% each. Revenue per unit of volume was also relatively weak, falling 3% and contributing to the top-line weakness.

Operationally, CSX did reasonably well. Personal injury frequencies worsened by 14%, but train accident rates fell by 10%. On-time originations and departures saw big boosts of more than 20 percentage points each, and train velocities sped up even as delay times at key terminals stayed level.

CSX CEO Michael Ward was pleased with the way the railroad performed. "CSX continued to drive strong customer service and network efficiency in a challenging market," the CEO said, "which is expected to persist throughout this year." Ward also said that CSX has done a good job of combining new strategic investments with smart reallocation of existing resources.

Is there more pain to come for CSX?

The problem, though, is that the tough environment is likely to hold back CSX longer than shareholders would like. Ward said that the railroad still expects 2016 full-year earnings per share to decline from year-ago levels, with currency impacts and the tough environment in commodities weighing on CSX's profit growth potential.

However, one area in which CSX has made substantial progress is in controlling its expenses, finding $183 million in cost cuts compared to year-ago levels. Reduced fuel prices produced about $56 million in savings for the railroad, but even more important has been the efficiency gains that CSX has managed to produce. Those savings added up to $96 million for the quarter, and actions like making structural changes, optimizing the length of the company's trains, and reducing expenses on overtime and crew training have added up to impressive cost cuts for the railroad. That in turn gives investors hope that CSX can build on those cost savings and make itself better able to maximize profit when industry conditions improve.

In a strange twist, CSX's earnings report became public more than an hour before the regular trading session ended Wednesday, and the stock went from being unchanged to finishing up more than 4%. Investors are clearly happy that CSX is positioning itself for the future, and they're willing to accept short-term contractions in earnings if it means finding daylight at the end of its current slump.