American railroad operator CSX (CSX -3.02%) just reported results for the second quarter of 2014. Shares rose and then fell in after-hours treading as investors digested the news.

GAAP earnings rose 4% year over year to land at $0.53 per share. Second-quarter revenue increased 7% to $3.2 billion, thanks to 8% higher shipping volumes.

Analysts were looking for earnings of $0.52 per share on $3.3 billion in revenue, making this report a mixed bag.

Management expects a "positive economic environment" plus sustained growth in the intermodal and petroleum markets to drive "modest" earnings growth in the 2014 fiscal year. Looking further ahead, CSX hopes to deliver double-digit earnings growth and margin expansion in 2015 and beyond.

To reach these goals, CSX is increasing its 2014 capital investment budget by $100 million, chiefly to expand the railcar fleet.

"With the broad-based economic momentum we are seeing, the core earning strength of this company is improving and driving value for shareholders," said CSX CEO Michael Ward in a prepared statement.

CSX shares have gained a market-beating 28% over the past year and briefly touched fresh all-time highs after today's closing bell.