Hyundai Motor has reached a deal with its union to end a protracted dispute which has cost more than 600 million dollars in lost production, the company has said.