General Motors has defeated a class action by Australian car dealers over its decision to retire the Holden brand, with a judge finding the car maker did not breach its agreements.