The Phillies are taking their lumps this season, enduring the mistakes and transgressions from their young players, and justifying it as valuable, on-the-job experience that might pay off someday.

The Giants are taking their lumps, too. Except they just sent Christian Arroyo, their 22-year-old top hitting prospect, back to the minor leagues.

On the day the Giants optioned Arroyo, their veteran roster demoted itself further down the National League power rankings. Maikel Franco and Freddy Galvis hit consecutive home runs off Derek Law in the eighth inning to send the Giants to a 9-7 loss – and award the Phillies their first series victory in more than a month.

If the Giants cannot beat a dysfunctional opponent that had lost 10 consecutive series, what will happen next, when they play the National League Central-leading Brewers in Milwaukee before coming home to face the American League Central-leading Twins?

Never miss a local story.

Sign up today for a free 30 day free trial of unlimited digital access.

“Yeah, well, you better execute a little better than we did today,” Giants manager Bruce Bochy said between grinding molars. “We’ll move on. We’ll try to stay … We won’t try. We will stay positive here. We’ve got to get better, whether it’s getting a bunt down or making pitches. It didn’t happen today, though.”

Asked what he could tell a veteran team accustomed to winning, Bochy interrupted.

“Tell me, what should we convey?” he said, his voice rising. “We’ve had meetings. They’re men. They’re … men. They know where we’re at.”

They are at a low point. They are fielding a team with a $200 million payroll, the most expensive in franchise history, and they are on pace to finish 64-98. They just dropped a series to the major leagues’ only team that had a worse overall record.

The Phillies appeared to be heading to their 11th consecutive series loss after the Giants rallied from a 6-3 deficit on the strength of Brandon Crawford’s two-run home run in the sixth and two-run single in the seventh.

But Josh Osich lost the lead three batters into the seventh when Odubel Herrera, one of those mistake-making young players, continued his havoc-wreaking series with an RBI double.

Herrera, who had four doubles and a homer over the weekend, entered Sunday’s game hitting .223. So did Franco, another supremely talented underachiever. But their talent surfaced in this series, and Franco was strong enough to lift Law’s pitch over the deepest part of the center field wall.

It resulted in another blown game for the Giants bullpen, although there were plenty of places earlier in the game when the baton clattered to the track.

Matt Moore had another bad one away from AT&T Park, where he has a 7.94 ERA in seven road starts. He gave up five runs (four earned) in four innings before he was lifted for a pinch hitter.

“You know what? We just made some terrible pitches, ahead-in-the-count pitches,” Bochy said. “We’ve got to be smarter than this. We made mistakes 0-1, 0-2. You can’t do these things in this ballpark. We got what you’re going to get when you don’t make pitches.”

Moore walked two batters, and perhaps it only seemed like more because both came to lead off innings. And both came around to score, of course, although one was an unearned run because third baseman Eduardo Nuñez let a potential double-play ball skip off his glove in the third inning.

Galvis hit a two-run shot batting right-handed off Moore in the second inning; his shot off Law in the eighth came from the left side, making him the first Phillies player since Jimmy Rollins to homer from both sides of the plate.

Bochy did not wish to discuss Moore’s road woes because he feared the issue might be creeping into the left-hander’s head. But getting him back in a groove could be a boon prior to the trade deadline, should the Giants wish to explore what he might bring one year after they acquired him for Matt Duffy and Bahamian bonus baby Lucius Fox, whose signing essentially closed the shop for three years on international free agents.

Moore could not pinpoint the issue for his lack of fastball command on the road but echoed Bochy’s insistence on keeping a stiff upper lip.

“It’s harder to do than saying it, but every single one of us has had low points throughout playing baseball,” Moore said. “Those times are just as important as when you’re doing well. You can pout about it or you can choose to thrive in it. For me, I have to fight my way out of it. Where’s the next one? And how do I get on the page with my fastball command?”

How does a team that has soaked up three World Series parades since 2010 deal with this?

“We’re used to winning,” Crawford said. “This organization for years has won a lot of games. You kind of get used to it as players. Yeah, it is surprising when you lose, and it’s frustrating. You’ve got to come out each day and expect you’ll win, and go out there with a positive attitude.”

Moore’s greatest contribution did not spring from his left arm but from his head. He singled in the third and his noggin got in the way when Phillies first baseman Tommy Joseph made an ill-advised decision to try for the forceout at second. The throw safely deflected off the top of Moore’s helmet for an error that put runners at the corners and set up a two-run inning.

The Giants drove in their runs on Brandon Belt’s bases-loaded walk and Buster Posey’s sacrifice fly, but the hit continued to elude them with the bags full.

To that point, they had a whopping nine plate appearances in the series with the bases loaded and were 0 for 5 with two sacrifice flies and two walks.

Crawford had the breakthrough hit. First, his opposite-way shot in the sixth inning cut the Phillies’ lead to 6-5. Then he ripped his single in the seventh after the Giants had loaded the bases on two singles and a hit batter.

The least productive N.L. offense, which Crawford owed to the difficulty of getting any two hot streaks to intersect this season, wasn’t a culprit this time. The Giants just couldn’t hold on.

And it is a hard thing for seasoned vets to absorb this many body shots. Their average roster age increased prior to the first pitch, when the club activated Hunter Pence from the disabled list and sent down Arroyo, who had some big moments to win a couple games but had slumped to a .194 average.

Pence will return to the lineup Monday in Milwaukee. Bochy preferred to use him off the bench Sunday afternoon, after a long day of cross-country flying. Pence entered right field on a double switch and grounded into a double play in the eighth.