U.S. regulators ordered two railways to detail their plans to speed shipments of grain, amid a monthslong backlog that has frustrated farmers.

The Surface Transportation Board ordered BNSF Railway Co. and Canadian Pacific Railway Ltd. to disclose plans to address the delays, which have forced some farmers in the upper Midwest to heap grain on the ground after running out of storage space following massive harvests of last autumn.