The Rangers had scored 29 runs in his first three starts since coming off the disabled list. They had averaged 9.29 runs per nine innings in his eight starts.
But one run was sufficient Saturday night.
Hamels, who got a no-decision, and Danny Duffy matched up in a pitcher's duel.
"We were both having really short innings so we were kind of building off that and getting through the game, and all of a sudden, you look up and it is the eighth inning, it is the ninth inning," Hamels said.
"Duffy is a tremendous pitcher. He was making good pitches, getting good outs, and it was up to me to go out and match him. It was kind of nice to be able to do that."
Jonathan Lucroy led off the ninth with a single and Gallo ran for him. Delino DeShields' sacrifice bunt advanced Gallo to second. Choo, who was mired in a 4-for-33 skid, singled to left on Duffy's next pitch, getting Gallo home.
"Obviously the run scored on those 130-foot hits, but there could have been so many more base runners," Duffy said. "I didn't look back at the two singles in the ninth, but obviously it was pretty weakly hit so I'm guessing that I executed pretty well. On paper those beat us, but our team kept us in the game."
Duffy (5-6) permitted one run on five hits over 8 1/3 innings. He struck out four and walked none.
Gomez singled in the fifth, but Duffy picked him off. Gomez had a one-out fly ball single to right in the eighth, but was soon erased when Rougned Odor grounded into a double play.
The Rangers asked for a crew chief review on Napoli's triple that landed high off the right-field fence. After an 88-second review, the call stood.
"I knew the ball hit the rail. We wanted to make sure it didn't ricochet off a fan, which would have been a home run," Rangers manager Jeff Banister said. "We didn't want to leave a run off the board at that point."
Hamels was just as good as Duffy. He worked out of a bases-loaded jam in the fourth. The next hit off Hamels was Lorenzo Cain's two-out single in the sixth.
Hamels was removed after Whit Merrifield's two-out double in the eighth on his 99th pitch.
Jose Leclerc replaced Hamels and struck out Jorge Bonifacio to end the inning. Hamels extended his scoreless-inning streak to 21 innings, the longest active streak in the American League.
Hamels allowed four hits, one walk and five strikeouts over 7 1/3 innings. Leclerc (2-2) picked up the victory.
"Both pitchers were at their top of their game. Both pitchers were throwing the ball extremely well," Royals manager Ned Yost said. "Two jam shots. Lucroy hit the ball that kind of dunked into right field and then the bunt. Choo's ball that he fisted on a changeup and dumped into left."
After Leclerc walked Lorenzo Cain on four pitches to lead off the ninth, Alex Claudio replaced him. Claudio fell behind in the count 3-0 to Eric Hosmer before striking him out and got Salvador Perez to ground into a game-ending double play.
"This really stinks because Duff pitched so well," said Hosmer, who went 0-for-4 to end his 16-game hitting streak. "And we just couldn't get a run for him."
The Royals (44-45) have lost five straight while the Rangers (45-45) have won five of their last six games. The Rangers have won 12 straight over the Royals dating to last season.
NOTES: Royals RHP Nathan Karns will undergo thoracic outlet syndrome season-ending surgery Wednesday. Manager Ned Yost is optimistic Karns will be ready to go in spring training. ... Rangers RHP Keone Kela threw off the mound Saturday for the first time since going on the disabled list. He went on the disabled list July 3 with shoulder stiffness. ... Royals 3B Cheslor Cuthbert will begin a minor league rehab assignment Monday with Triple A-Omaha. He is on the disabled list with a left wrist sprain. ... The Rangers sent minor league infielder Yeyson Yrizarri to the White Sox in exchange for international slot compensation. Yrizarri, 20, hit .258 with seven home runs in 82 games with two Class A clubs this season. ... RHPs Yu Darvish of the Rangers and Ian Kennedy of the Royals are the Sunday probables for the series finale.