Hiura homered and drove in three runs, Lyles turned in another strong start and Milwaukee snapped St. Louis' six-game winning streak with a 4-1 victory Wednesday.
The Cardinals had won 15 of 18, including two at Miller Park this week in matching their longest winning string of the season.
The Brewers ended a three-game skid. Third in the division, they trail the Cardinals by 5 1/2 games.
"We needed a win," Brewers manager Craig Counsell said. "We played a nice game, but we would have taken any kind of win."
Milwaukee got off to a fast start against Jack Flaherty (8-7), who had given up a total of just one run in his previous five starts.
Trent Grisham led off the first inning with a single, went to third on a throwing error by second baseman Kolten Wong and scored on a groundout by Hiura. Milwaukee made it 2-0 in the second when Ryan Braun doubled and later scored on Orlando Arcia's sacrifice fly.
Hiura hit a solo home run in the fourth, sending a 3-0 fastball from Flaherty into the left-field seats. Hiura added an RBI double in the eighth.
"It was big. Salvage the series, get the last win, and take it into the off-day," Hiura said.
Lyles (9-8), acquired from Pittsburgh in a trade on July 29, set the tone for Milwaukee. The right-hander, who had held Arizona hitless in a six-inning outing in his last start, struck out five of the first seven Cardinals he faced. He fanned nine in 5 1/3 innings.
Molina hit two singles and went 7 for 11 in the series. He homered three times in the first two games -- the veteran catcher has just seven home runs this season.
"We can't ignore the fact that that's a lot of games in a row and we played really well the whole stretch," said Cardinals manager Mike Shildt, noting his team had played 16 games in a row without a day off. "This group likes to play, though. This group will play in a back field or a parking lot, if that's where you tell us to play."
Wong hit his 10th homer, connecting in the sixth off Lyles. He also doubled and singled.
"To expect a sweep at this level is tough," Wong said. "Getting them is amazing, but winning series, that's the No. 1 goal."
Christian Yelich singled and walked in four plate appearances. The reigning NL MVP hasn't hit a home run in 10 games, his longest drought of the season for Milwaukee.
Cardinals: Wong returned to the starting lineup. He had not started for three games after fouling a ball of his right big toe Saturday. "You get your toenail drilled to release blood, that can't feel real great," Shildt said. "I appreciate and respect, and it is very important, his mentality to want to stay and get back to competition."
Brewers: 3B Mike Moustakas said there is no timetable for his return. He has been out since leaving Monday's game in the third inning with pain in his left palm and wrist after being struck by hard-hit groundball.
Cardinals: A three-day, four-game series against the Reds starts Friday in St. Louis. Cardinals RHP Dakota Hudson (13-6, 3.47 ERA) faces Reds RHP Trevor Bauer (10-11, 4.34 ERA) in the opener. Saturday features a day-night double-header.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP-Sports
Travis Shaw apologizes for tweets critical of Blue Jays' virus plan
Blue Jays infielder Travis Shaw apologized for recent comments that were critical of the team's plan to have players stick to Rogers Centre and the connecting hotel if games are played in Canada.
Dodgers closer Kenley Jansen says he has recovered after testing positive for COVID-19
Dodgers closer Kenley Jansen expects to be ready for the season opener after testing positive for COVID-19 nearly three weeks ago.
Yu Darvish swayed to play by teammates' conviction
Cubs starter Yu Darvish wasn't sure about playing due to the coronavirus pandemic, but he changed his mind when he saw his teammates' conviction.
Two-time All-Star second baseman Frank Bolling dies
Frank Bolling, a two-time All-Star second baseman and the last player to hit a grand slam off Sandy Koufax, has died. He was 88.
Atlanta Braves not changing name, looking at 'chop' celebration
The Atlanta Braves said they will not change their name but are considering whether the tomahawk chop is appropriate.
Yankees' Aaron Judge out another day with stiff neck
Yankees slugger Aaron Judge was held out of action for a second straight day Sunday due to a stiff neck.