A CN locomotive moves in the railway yard in Dartmouth, N.S. on Monday, Feb. 23, 2015. THE CANADIAN PRESS/Andrew Vaughan

MONTREAL — The Federal Court of Appeal has upheld a ruling that found the courts have jurisdiction to determine the damages Canadian National Railway Co. must pay after breaching its service obligations to a Prairie grain shipping company during a bumper crop five years ago.

The case goes back to a complaint filed by Calgary-based Louis Dreyfus Commodities Canada Ltd. to the Canadian Transportation Agency.

Dreyfus said CN failed to provide enough rail cars to some of its grain elevators in Alberta and Saskatchewan to ship the record 2013-2014 grain crop.

The agency ruled in favour of Dreyfus and CN filed an appeal, arguing unsuccessfully that the transportation regulator did not take into account the exceptional size of the crop, the effect extreme cold weather had on the rail system or demands from other grain companies.

CN also argued before the Federal Court that it lacked jurisdiction to consider damages based on the railway's confidential contract with Dreyfus.

The decision Thursday by the appeal court rejected that argument. The tribunal did not disclose any damages to be paid by CN.