Andrus snapped a 4-all tie when he led off the fifth with his 16th homer, lining a ball that just cleared the 8-foot wall in center. He added a two-run single an inning later when the Rangers scored four more times.
Ian Kinsler led off the game with a homer for Detroit, then after taking his position at second base in the bottom of the first received an on-field handshake from the longtime umpire who he said should get another job.
A day after Kinsler's harsh and extended criticism of Angel Hernandez, the umpire was working second base for the series finale. Kinsler was ejected from the opener Monday when questioning balls and strikes during the middle of an at-bat while Hernandez worked behind the plate, and the second baseman lashed out the following day.
Joey Gallo homered for the third straight game and AL-high 10th time in 14 games this month. His 35th homer was a towering solo blast estimated at 420 feet in the Texas eighth.
The Tigers twice in the first three innings had two-run leads against Hamels (8-1), who had allowed only one unearned run over 16 innings while winning his first two starts this month. The ace left-hander gave up four runs and eight hits with a season-high five walks in six innings.
Detroit led 2-0 before Adrian Beltre singled starting the second, and Nomar Mazara then homered. Kinsler led off the third with a walk before Mikie Mahtook's homer, but the Rangers got even again in the bottom half when Andrus walked and Beltre homered for his 3,019th career hit.
Andrus homered off reliever Chad Bell (0-1), the only run the lefty gave up in his 2 1-3 innings.
Miguel Cabrera was initially called safe at second base by Hernandez when trying for a double in the seventh. The Rangers challenged the call, and Cabrera was already back in the dugout before umpires had completed the review of the replay. SS Andrus took RF Mazara's strong throw and tagged Cabrera on the back just before he got to the bag.
Tigers: Starting pitcher Anibal Sanchez exited after only 2 1-3 innings because of left hamstring tightness. He had a 3-0 count on Mazara after allowing the homer to Beltre.
Rangers: LHP Jake Diekman is scheduled to start a rehab assignment with Double-A Frisco, and throw 15 pitches in his first game since three surgeries this year to remove and rebuild is colon. ... OF Carlos Gomez has a cyst in the middle of his back and missed his third straight game. The team had said the previous two days he wasn't feeling well.
Tigers: A much-needed day off Thursday. They host the Los Angeles Dodgers on Friday night.
Rangers: Tyson Ross (3-2, 7.11) starts in the opener of a four-game series Thursday night against the White Sox.