Logan Morrison homered off McHugh in the eighth to tie it, but the Mariners fell a half-game out in the race for the second AL wild card.
Villar bounced a 1-1 fastball to the right of second baseman Robinson Cano, who made a dive for the ball as it skipped over his glove and rolled into right field.
McHugh (9-9) permitted only two hits in eight innings - an infield single in the fourth and Morrison's long homer off the facade of the second deck in right field. The right-hander struck out four and walked none.
Josh Fields worked the ninth for his fourth save.
Roenis Elias pitched six innings for the Mariners, allowing one run and six hits. He walked two and struck out four.
The Astros scored with two outs in the fourth. With Jake Marisnick on first, Singleton sent a line shot to right that hit the yellow line at the top of the 8-foot wall.
In his attempt to gather it in, right fielder Michael Saunders bobbled the ball twice. That allowed Marisnick to beat the relay home on the double.
A replay review kept the Astros off the board in the sixth.
With two outs and runners on first and second, Singleton bounced a grounder to the right of Morrison at first base. He made a high toss to Elias covering. Elias leaped for the ball and came down on the bag at the same time as Singleton.
Singleton was ruled safe, and Chris Carter raced across the plate. Mariners manager Lloyd McClendon challenged the call at first, which was reversed.
Joe Beimel pitched to one batter in the ninth for his 50th appearance. That gave the Mariners seven relievers with at least 50 appearances, matching the major league record set by the 2002 Atlanta Braves.
Mariners: An MRI revealed bone spurs in OF Dustin Ackley's painful left ankle. He missed his third straight game. The club hopes he can return for the weekend series against Oakland.
Mariners RHP Hisashi Iwakuma (14-6, 2.97 ERA), who starts the series finale Wednesday, is 6-1 with a 2.70 ERA in his last eight starts. He has as many wins as walks this season.
Iwakuma will be opposed by RHP Nick Tropeano, making his major league debut. The September call-up was a fifth-round selection in the 2011 draft.