Judge Bernadette Farnam said there were faults on all sides, and it was a life-changing situation for the two managers.
She sentenced each of the men to 275 hours community work, plus a $10,000 fine plus court costs.
Castlerock Dairies Limited has also been fined $37,500, plus prosecution costs of $11,500.
MPI lawyer Grant Fletcher said the scene was disturbing, and argued the animals suffered because the men had not done their jobs.
"The company was amiss in the direct control of the farm's situation, and the managers were amiss by not grasping what had happened, not recognising what had happened, and taking steps to deal with that," Fletcher said.
Castleford Dairies defence counsel Garth Galloway said the company was willing to put money in for proper track maintenance, and disputed there had been refusals for financial help in the past.
McMillan's counsel Rachel Adams said the scale of the farm, combined with severe weather that deteriorated the tracks in April and May had created a perfect storm.
Matthews' counsel Kate Logan said it was her clients' first appearance in court and until then they had a blemish-free record.
The two men are no longer with Castlerock, but have found other work managing dairy farms.