BALTIMORE — Joe Girardi has used the same line over the years when a trusted reliever doesn’t get the job done, and he went to it again Sunday.

“They’re not going to be perfect.”

That was the case for Dellin Betances and Aroldis Chapman and, unfortunately for the Yankees, it occurred in a game they needed them to be. First Betances, then Chapman couldn’t finish things off, leading to a brutal 3-1 loss to the Orioles on a muggy afternoon at Camden Yards.

There was a 1-hour, 37-minute rain delay in the bottom of the eighth, interrupting what became the winning rally. The Yankees (26-30), who went 4-6 on the four-city trip, start a four-game series with the Angels at the Stadium Monday night.

“I just feel like that’s a game we should have won,” Brett Gardner said. “We scored one run, we have to do better than that. We had a chance to win the series and we kind of gave it away.”

Both offenses were mostly awful, each stranding 10 and going 3-for-22 with runners in scoring position. But the Orioles (32-23) came through when they needed to.

CC Sabathia battled command issues but grinded his way through five shutout innings. After he walked Chris Davis to start the sixth, Girardi brought on righthander Kirby Yates to face Nolan Reimold. Yates retired three straight, two on strikeouts, before giving way to Betances. The righthander, who has allowed at least one run in four straight outings, got out of the seventh, stranding Ryan Flaherty at third by striking out Manny Machado.

As apocalyptic clouds settled over the stadium, Betances started the eighth by walking Mark Trumbo, then allowing a hit to Davis. With the count full and the crowd roaring, Betances struck out Reimold on a 97-mph fastball. Girardi called for Chapman and crew chief Bill Miller called for the tarp.

The rain began falling no more than two minutes later.

“You don’t want to put your closer in that situation,” Betances said of turning things over to Chapman with runners on first and second. “I put him in a tough spot.” Betances (2-4) said there’s no physical reason for his slump.

When play resumed, Chapman struck out Jonathan Schoop on a 100-mph fastball. But Francisco Peña, the son of Yankees first-base coach Tony Peña, loaded the bases with a single to rightfield. Aaron Hicks charged the ball and bobbled it, but Trumbo held at third before Hicks made a strong, accurate throw home. Pinch hitter Matt Wieters fell behind 0-and-2 before singling up the middle. Two runs scored, and a third came across on Jacoby Ellsbury’s wild throw home — Chapman, to the irritation of Girardi, did not back up behind the plate.

When asked about the long delay, Chapman said, “I don’t think it affected me at all,” although he was forced to warm up twice. “I felt good.”

Of the 101-mph fastball Wieters banged into center, Chapman said: “I wanted to go with the high pitch. Unfortunately, it went down, and he hit it.” It was his first blown save in 10 chances as a Yankee.

Sabathia (3-4, 2.58 ERA) allowed two hits and six walks, matching a career high, in five-plus innings. He has a 0.87 ERA in his last five games, allowing 18 hits and 11 walks for a 0.94 WHIP.

The Orioles’ Kevin Gausman had at least one baserunner in each of his six innings but allowed only one run and seven hits. The run came in the third on a two-out single by Alex Rod riguez, who had three hits in Saturday night’s 8-6 victory.

“We have a good team in there, we know what we’re capable of,” Sabathia said of his club, which is 4-8 since reaching .500 May 24. “We just have to put it all together. We haven’t done that yet, but you see what we can do when we got on a roll to get back to .500. I’m confident we can get back to .500 and play well after that.”