Alvarez singled off Gregory Soto (1-2) with no outs in the ninth on a ball that hit off the wall in left-center. Thinking it was a home run, he remained in the box watching the ball before finally hustling to first base. He was replaced by pinch-runner Chas McCormick and immediately approached manager Dusty Baker in the dugout to apologize for the mistake.
"Baseball is a game, like life, that teaches you lessons sometimes, so that probably won't happen again," Baker said. "I'm glad that we won the game. We all thought it was gone, but the ball's not gone until it disappears over the fence. He learned a lesson. He would have really felt bad had we lost that ball game."
Alvarez said the team getting the win made him feel a little better about the situation but added that it doesn't make what he did OK.
"I froze a little bit after I hit the ball," he said via interpreter. "I thought the ball was gone but obviously that doesn't justify me not running."
Yuli Gurriel walked before Tucker singled on a groundball to center field to score McCormick and give Houston its fourth straight victory.
Tucker's hit helped the Astros bounce back after closer Ryan Pressly blew the save in the top of the inning in his return from the injured list.
The Astros led 2-0 with two outs in the ninth when Pressly (1-1) allowed a single to Miguel Cabrera. Jeimer Candelario's two-strike shot to the second deck in right field tied it at 2.
"It felt good to get out there and it was just a very poorly executed pitch," Pressly said. "Probably a handful of times that I can count that I've done something like that and it's frustrating, especially being the first time out."
Houston starter José Urquidy allowed six hits over six scoreless innings. Héctor Neris gave up one hit in the seventh and Rafael Montero struck out one in a scoreless eighth before Pressly stumbled.
"Tough loss, tough league," manager A.J. Hinch said. "Hopefully the energy at the top half of the (ninth) will carry over to tomorrow."
Altuve sent Tarik Skubal's first pitch of the game into left-center for his third homer this season. Altuve was in the lineup a day after fouling a ball off his groin area.
Skubal gave up six hits and two runs with a season-high nine strikeouts in six innings.
Cabrera had three singles to move past Al Kaline for 31st most hits in MLB history at 3,008.
Astros: Pressly had been out since April 14 with right knee inflammation. LHP Parker Mushinski was optioned to Triple-A Sugar Land to make room for Pressly on the roster.