Biggar RCMP said five cars derailed while being moved in the yard just before 6:30 a.m.
All the cars remained upright, police said, and no dangerous goods were involved.
Police said the crossing at highways 4 and 51 was blocked by one of the derailed cars.
The highway reopened at roughly 9:45 a.m.
CN has not said what caused the derailment.