Even with Jason Heyward batting leadoff, the Braves figured to face a tough challenge in this four-game series against a resurgent Cardinals team that’s in a tight division race and had its best starters going in the first three games.

With Heyward back in Atlanta recovering from a broken jaw, the Braves haven’t been up to the challenge.

Shelby Miller out-pitched Julio Teheran in a matchup of top rookie starters, and the Cardinals scored three runs in the seventh inning to pull away to a 6-2 win at Busch Stadium, their third in a row to start the series.

“We’ve got to start swinging the bats,” said manager Fredi Gonzalez, whose Braves had just four hits and one run before tacking on a run on three consecutive two-out hits in the ninth inning. “We’ve got to keep the line moving offensively. I think our pitching will be fine, but I think we need to start swinging the bats again.”

The Braves have totaled five runs while losing all three games since Heyward went on the disabled list after getting hit in the face by a fastball Wednesday at New York. It’s the first time they’ve lost three consecutively since July 3-5, when they lost the last two games in a series against the Marlins and a series opener at Philadelphia.

Catcher Brian McCann was asked if Heyward’s absence from the leadoff spot seemed to affect the Braves throughout the lineup.

“I don’t think so,” he said. “We hit a lot of balls hard tonight, too. We just didn’t get anything going. They made good plays when they had to.”

Miller (11-8) limited the Braves to three hits and one run with eight strikeouts in seven innings, after Adam Wainwright threw a six-hit complete game with nine strikeouts in the Cardinals’ 3-1 win Friday. After Freddie Freeman’s two-out homer in the first inning, Miller retired 19 of the last 22 batters he faced.

Braves hitters haven’t draw a walk in 20 innings. McCann said it was a combination of St. Louis pitching and cold Braves bats that contributed to the dearth of Atlanta offense in the series.

“When Wainwright’s on, Wainwright is one of the toughest guys to hit in the game,” McCann said. “They’ve got really good arms over there. You’re facing a guy tonight throwing 94-96 (mph) with a good changeup. But at the same time, we have to have a little bit better at-bats.”

With the Braves trailing 2-1, McCann hit a long fly ball the seventh inning that looked as if it might be a tying home run. But center fielder Jon Jay raced over and made a terrific, leaping catch just in front of the wall.

Teheran (10-7) was charged with five hits (two homers) and four runs in six innings, with five walks and eight strikeouts.

“I didn’t have my best stuff, but I was battling through the whole game and trying to keep my team in the game,” said Teheran, who struggled particularly with his slider, normally one of his best weapons.

Both home runs came on hanging sliders, to Matt Carpenter leading off the first inning and Carlos Beltran in the third, the latter putting the Cardinals ahead, 2-1. Four of his walks came on four pitches, only one an intentional walk.

“He didn’t have his best stuff today, that’s for sure,” McCann said. “But to get through this lineup without your best stuff, and give us a chance to win, I tip my hat to him. He made his pitches when he needed to.”

The Braves fell to 1-4 on their six-game trip and were handed their first series loss since July 19-21, when they lost two of three against the White Sox in Chicago. They won seven consecutive series before splitting two games against the Mets to start the current trip.

They’ve lost seven of 13 since a 14-game winning streak, and the Braves’ lead over second-place Washington in the National League East has gone from 16 to 12 games in five days. They’ve also seen their lead erode in the race for the league’s best record and home-field advantage through the NL playoffs.

Pittsburgh was a half-game behind the Braves (77-52), pending the outcome of the Pirates’ late game at San Francisco, and the Dodgers (76-53) a game behind the Braves.

Mike Minor (12-5, 3.06 ERA) will start Sunday’s finale against Cardinals righty Lance Lynn (13-7, 3.97), and the Braves need a win to avoid being swept for the first time since they lost three at San Diego on June 10-12.

After Freeman’s first-inning homer, the only Braves to reach base in that span were Teheran on a third-inning error, Chris Johnson on a fourth-inning single, and Andrelton Simmons on a two-out single in the seventh.

Beltran put the Giants ahead to stay when he took Teheran deep in the third inning, on the seventh pitch of the at-bat after fouling off a pair of fastballs and a curveball.

Teheran was replaced after giving up two singles to start the seventh, the Braves trailing 2-1. David Carpenter recorded one out before allowing three consecutive hits to bring in the last two runs on Teheran’s ledger and one on his own.

It was the fifth two-homer game against Teheran this season and first since July 14, when he allowed two at home against Cincinnati. Before Saturday, the right-hander had allowed two homers combined in his six starts since losing to the Reds.

For Beltran, it was his 24th homer this season and 21st in 109 career games against the Braves, which doesn’t include four homers he hit against them for Houston in the 2004 division series.