"It was important to be ready," Guerra said. "I think overall I went in there prepared and got the right results. It went well."
After Wei-Yin Chen (4-8) pitched 5 2/3 innings of one-hit ball, Miami led 2-0 going into the ninth and handed the game off to Barraclough.
Paul DeJong and Harrison Bader opened the inning with hard-hit singles, then Yairo Munoz walked. Pinch-hitter Kolten Wong struck out looking, but Matt Carpenter drew a bases-loaded walk to make it 2-1 and end Barraclough's night.
"Carp works the walk and then you've got the guy that you want up there every night in that situation with Yadi," Cardinals interim manager Mike Shildt said.
Guerra got Molina, a career .309 hitter with the bases loaded, to bounce into a double play for his first save since Sept. 27, 2014 while with the Chicago White Sox.
"He saved (21 of 22) games for me in LA (in 2011)," Mattingly said. "I've seen him be in bases-loaded jams with nobody out and get out of them, so I know he's a guy who's not going to panic in that spot."
Barraclough had blown his last three save chances, allowing 10 runs in 2 1/3 innings.
His role could be in jeopardy.
"I think he's healthy," Mattingly said. "If he's not healthy, he's not telling us, which I don't think is the case, but it's something that obviously you're not going to sit here and make any kind of decisions quickly after a game. We just won a game and we wouldn't do anything without talking to him about it anyway."
Starlin Castro had two hits, including his ninth home run for the Marlins, who returned home after a six-game winless road trip.
Former Miami All-Star Marcell Ozuna returned for his first game at Marlins Park after being traded to St. Louis in the offseason and went 3 for 4 tying his season-high with hits in a game.
"It was good to see Marcie come home," Shildt said. "He was happy to get home. He felt good about it. He likes it here and it was good to see he was received warmly as you would expect."
Luke Weaver (6-10) allowed two runs and seven hits in six innings for St. Louis.
Castro's home run to left in the fourth gave Miami a 2-0 lead.
Ozuna beat out an infield hit in the eighth, giving Jedd Gyorko an at-bat with runners on first and second with two outs. Drew Steckenrider was able to get out of the jam as Gyorko flew out to deep center.
Ozuna was given a video tribute during the game, and he tipped his cap to acknowledge the appreciation.
"That was impressive for me," Ozuna said. "I didn't even know they were going to do that for me. I appreciated it."
CHEN STRONG AT HOME
Chen improved to 3-2 with a 1.94 ERA in nine home starts this season compared to 1-6 with a 10.27 ERA in nine road starts.
"He never looks really any different at home or the road, it's just that he's pitched so much better here and that's really the only difference," Mattingly said. "You see his work, you see his preparation, it's no different. It's not like he's serious here and then he goes on the road and he's yucking it up and not taking it serious."
Cardinals: OF Tyler O'Neill (groin) was placed on the 10-day disabled list retroactive to Aug. 4. ... RHP Adam Wainwright (elbow) is planning on throwing a bullpen session either Tuesday or Wednesday.
Marlins: RHP Sandy Alcantara (armpit) was reinstated from the 10-day disabled list and optioned to Triple-A New Orleans.
Cardinals: RHP Miles Mikolas (11-3, 2.75 ERA) is scheduled to start the second game of the series Tuesday night. Mikolas has allowed three runs or fewer in eight consecutive starts.
Marlins: RHP Pablo Lopez (2-2, 4.67) allowed one run in six innings his last start, a no-decision at Philadelphia.
More AP baseball: https://apnews.com/tag/MLBbaseball and https://twitter.com/ap-sports
Japan scores four runs in 9th to beat MLB All-Stars, leads series 3-1
Japan rallied with four runs in the top of the ninth inning to beat the MLB All-Stars 5-3 and take a 3-1 lead in their six-game exhibition series on Tuesday.
Why are baseball managers so short?
In business and politics, taller people tend to make more money and get more votes. Most importantly, they're perceived as better leaders. But not in baseball!
Mauer gives tearful thank you during retirement speech
Joe Mauer gives an emotional thank you to Terry Ryan for drafting him to the Twins back in 2001.
Joe Mauer officially bids Twins farewell in tear-filled news conference
Twins legend Joe Mauer formalized his goodbye to baseball on Monday at a tear-filled yet cheerful news conference to wrap up a 15-year major league career at age 35.
Mariners deny ex-employee's claims of racism toward Latino players
The Mariners denied allegations made by a former employee that management called Latino players, especially those from the Dominican Republic, "dumb" and "stupid."
Ronald Acuna Jr. has flashed the talent to soon become NL's top player
While Shohei Ohtani and Ronald Acuna Jr. were named baseball's top rookies, the Braves outfielder has flashed the potential to quickly become one of the game's elite players.