The Canadian Transportation Agency says CN and CP Rail both made more money transporting grain in the 2014-15 crop year than they were entitled to.
The Agency has a formula it uses to determine that entitlement.
According to the CTA - CN's grain revenue was about 6.8 million more than it was entitled to.
CP's was about 2 point 1 million over.
The two rail companies how have 30 days to pay that money back - plus a five per cent penalty.
That money goes to the Western Grains Research Foundation, which funds research of benefit to Prairie farmers.
The maximum revenue entitlement allows CN and CP to set their own rates for services, as long as their total revenue collected from Western grain shipments remains below the ceiling set by the CTA.