After a scoreless first five innings, Kyle Schwarber put Philadelphia in front with a 395-ft solo home run at the top of the sixth.
The Astros responded well, with Jose Altuve and Jeremy Pena both getting on base.
Alvarez then sounded the death knell for the Phillies with a 450-ft bomb which gave Houston a crucial two-run advantage.
Christian Vazquez followed this up with a single to send Alex Bregman home and push the lead to three.
With their championship hopes on the line, Philadelphia’s offence faltered down the stretch, only managing one hit in the final three innings.
Houston’s starting pitcher Framber Valdez put together another superb performance on the mound, finishing with nine strikeouts while giving up just a single earned run.
The victory marks a major turnaround in fortune for the Astros, whose previous title in 2017 was marred by a cheating scandal.