Aaron Judge made history as the New York Yankees won their second game in a row, a 9-4 victory over the Pittsburgh Pirates.