Japan’s Toyota outsold GM, which had held the top spot for nearly a century.