The crew of a ship carrying cars and electric vehicles from China to Mexico has evacuated after failing to put out a fire on board.