(Recasts; adds analyst expectations, comment on new crude by rail regulation)
TORONTO, July 25 (Reuters) - Canadian National Railway Co reported better-than-expected second-quarter earnings on Monday even as a decline in shipments cut into revenue, but said it expects volumes to improve in the months ahead.
Chief Executive Luc Jobin said the railway faced a "very challenging volume environment" in the quarter, but sees business improving in the second half.
"We expect the second quarter to be the volume trough for the year," he said in a statement, noting that the railway expects a big grain harvest in Canada.
Montreal-based CN Rail confirmed its forecast for full-year earnings per share in line with last year's C$4.44 a share.
Net income fell to C$858 million ($649.07 million), or C$1.10 a share, from C$886 million, or C$1.10 a share, a year earlier. Revenue fell 9 percent to C$2.84 billion, as carloads fell 12 percent to 1.25 million.
Excluding the impact of deferred income tax adjustments, adjusted earnings fell to C$1.11 a share from C$1.15 a share, topping analysts' expectations for earnings of C$1.06 a share.
Analysts, on average, had been expecting revenue of C$2.91 billion, according to Thomson Reuters I/B/E/S.
The railway's operating ratio, a key measure of efficiency, improved to 54.5 percent from 56.4 percent a year earlier.
Canadian Pacific Railway Ltd, the company's chief rival, last week reported lower second-quarter earnings, but also forecast a recovery in shipments in the second half of the year.
Separately on Monday, the Canadian government said it would take some older tank cars out of crude-by-rail service earlier than originally planned.
On a conference call with analysts and investors, Jobin said none of the affected cars are currently carrying crude on CN Rail's network.
"We don't need that fleet," he said. "This is good news for society. I think it's good news for the railroad, from a safety point of view." ($1 = 1.3219 Canadian) (Reporting by Allison Martell; editing by Sandra Maler, G Crosse)