The court heard the pair had been travelling at "grossly excessive speeds" as they raced each other.
Abraham Torrance, from Kilmarnock, was killed in the crash between the Corsehillmount Roundabout and Warrix Interchange.
Police were called to a collision involving a grey Kia Ceed and a white DAF HGV on the A71 near Dreghorn in North Ayrshire.
Lesley McTear, 59, from Dreghorn, died after a crash between a car and a van in Renfrewshire on Monday.
Shona McKinlay, from Dreghorn, died in the accident on the A70 between Ayr and Coylton last month.
Shona McKinlay, from Dreghorn, died in the crash on the A70 between Ayr and Coylton on Friday.
Steven Gallagher, 48, has a new lease of life after undergoing pioneering surgery last December.