Yet even as his woes mounted, manager Clint Hurdle stuck by Barajas, sending him to the batter's box with the tying run on third and two outs in the ninth against Washington on Tuesday night.
"I thought, What the heck? He's hit a few homers before," Hurdle said.
Hurdle's faith paid off when Barajas drilled a two-run homer off closer Henry Rodriguez to lift the Pittsburgh Pirates to a 5-4 victory.
Alex Presley singled with one out in the bottom of the ninth off Rodriguez (1-2) and moved to third on a pair of wild pitches before Barajas broke through.
"I kind of figured (Rodriguez) was going to come hard," Barajas said. "I wasn't going to let one go by if it was where I like it."
Tony Watson (2-0) earned the victory after replacing Hanrahan.
Rodriguez, perhaps unsettled after walking Presley and then letting him advance to third by bouncing a pair of breaking balls past catcher Wilson Ramos, threw a fastball that Barajas hit into the seats for his first home run since last September when he played for the Los Angeles Dodgers.
"(Rodriguez) usually has pretty good command of his curveball and that kind of got him in a jam, and I thought he was still going to get out of it," Washington manager Davey Johnson said. "Obviously, Barajas knows he's going to get a fastball and he gets out in front, and that's the ball game."
Barajas raised his arms in triumph and nearly slipped rounding first base before getting mobbed by his teammates after crossing the plate.
It was vindication for Barajas, who was booed heavily after popping up in the seventh inning.
"I'd love to be doing better; nobody wants to hear that from your home fans," he said. "I was in a situation where I was able to put them back on my side. Hopefully they'll give me a little more leeway."
Andrew McCutchen hit his first homer of the season for the Pirates and Garrett Jones added his fourth. Neil Walker gave Pittsburgh a 3-2 lead in the bottom of the eighth with a sacrifice fly off Washington reliever Tyler Clippard.
The lead lasted all of two batters.
Ryan Zimmerman, playing in his first game since April 20 after spending more than two weeks on the disabled list with inflammation in his right shoulder, singled off Hanrahan and LaRoche smashed a 97 mph fastball from Hanrahan just over the wall in center.
The Nationals, who have climbed to the top of the National League East thanks to nine wins in one-run games, turned to Rodriguez. He struggled against the bottom third of one of baseball's weakest lineups while blowing his second save of the season.
"I feel terrible for Henry," LaRoche said. "He wants to win as bad as anybody. I know it's killing him ... with the little things that are going on. And then to throw 100 and have a guy run into it to walk you off, it's frustrating."
Washington rookie outfielder Bryce Harper went 1-for-4 with a double while starting in right field in place of Jayson Werth, who was placed on the 15-day disabled list after breaking his left wrist in a loss to Philadelphia on Sunday.
Werth will be out at least three months, meaning Harper is likely here to stay. He certainly appears ready. The 19-year-old is batting .300 with six doubles in just nine games.
The late struggles by the closers was in stark contrast to the work done by both starters.
Washington's Edwin Jackson was stellar, giving up three hits in seven innings, striking out five and walking one. He retired the final 10 batters and needed just 91 pitches to deal with baseball's lowest-scoring team.
Pittsburgh's A.J. Burnett, lit up for 12 runs in 2 2/3 innings by St. Louis last Wednesday, bounced back with the kind of performance the Pirates were looking for when they acquired him in a trade with the New York Yankees in February.
The 35-year-old gave up a solo homer to Ramos leading off the third and an RBI single by Rick Ankiel in the fourth. Otherwise he was dominant and grew stronger as the night wore on, allowing two runs and six hits in eight innings, walking one and striking out 10.
"Both starters pitched a great ballgame, and the guys who were supposed to save it both gave it up," Johnson said. "Henry's been pretty good all year long, and he gave up the one that beat us. But he'll be back and he'll be fine."
The Nationals are 9-5 in one-run games this season, with all five losses coming on the road ... The series continues on Wednesday. Ross Detwiler (3-1, 1.59 ERA) will start for the Nationals against Pittsburgh's Erik Bedard (2-4, 2.65) ... Pittsburgh's Pedro Alvarez is 0-for-8 since moving to cleanup on Saturday.