49ers used a late second-quarter burst to take control of game in Mexico City and move to 9-1 on the season.