San Francisco Giants pitcher Sergio Romo reacts after the final out in Game 7 of the NLCS. The Giants won 9-0 to advance to face the Detroit Tigers in the World Series, which begins Thursday, Oct. 25. (David J. Phillip/AP)

There had to be times, when he made his bed across the Pacific Ocean and wore the uniforms of the Hanshin Tigers or the Orix Buffaloes, in which Ryan Vogelsong couldn’t have envisioned a night like Sunday. He had blown out his elbow. He had been to the minors. He pitched in Japan because he couldn’t get hitters out, and therefore couldn’t get a major league job.

But Sunday, at packed AT&T Park, the 35-year-old — who Lewis and Clark would refer to as a “journeyman” — was nothing less than a season-extending star. The San Francisco Giants beat the St. Louis Cardinals, 6-1, in Game 6 of the National League Championship Series because Vogelsong pitched the game of his life, seven innings of one-run ball in which he struck out nine and was scarcely threatened.

“What a ride for him,” Giants closer Sergio Romo said. “Ups and downs. I’m very proud of that man, very proud to know him. . . . I don’t know if I would’ve had the strength that he had to go through the things that he’s been through.”

Had Chris Carpenter, the Cardinals’ veteran right-hander who lasted just four innings Sunday, turned in that performance, it would have added to a legacy forged in Octobers past. For Vogelsong, this is it, his first postseason, a dozen years and 10 professional teams in the making. He not only spent time in the minors, but he spent time in the Japanese minors.

“He’s learned how to fail; he’s learned how to succeed,” reliever Jeremy Affeldt said. “. . . He’s been preparing for this game his whole life.”

How could he have been prepared for Sunday, chants of “Vog-ey! Vog-ey!” ringing through AT&T Park? What he provided everyone: A winner’s-in-the-World Series, loser-goes-home Game 7 between teams who don’t lose games like they’ll face Monday night. The Giants’ victory Sunday was their fifth this postseason that, had they lost, would have ended their season. Since they faced elimination after Game 4 of this series, they have outscored the Cardinals, 11-1.

“Doing it alone is impossible,” Romo said. “Everybody here wearing this uniform, everyone’s pulling on the same rope at the same time.” He broke into a smile. “I really don’t want to go home! That’s really the mind-set.”

But the Cardinals, over two postseasons, have been perhaps more resilient. Dating from the 2011 division series against Philadelphia, they have won six straight elimination games. In two of them they were twice down to their last strike.

“Unfortunately, we don’t win until we absolutely need to,” said right-hander Kyle Lohse, who will start Game 7 for St. Louis.

So who to pick here? The Giants will go with their stud, Matt Cain, who went 16-5 during the regular season. The Cardinals chose Lohse to pitch the most crucial games this postseason. The two produced the best-pitched game of this series, a 3-1 Cardinals victory in Game 3.

So flip a coin. But if either pitches like Vogelsong did Sunday, he’ll have the edge. His first time through the order, Vogelsong struck out six Cardinals. By the fourth inning, he had matched his career high with seven punch-outs. With two outs in the fifth, he hadn’t allowed a hit, and when he did, it was Daniel Descalso’s broken-bat flare.

“He did everything he wanted to do to us,” Cardinals Manager Mike Matheny said.

From early on, Vogelsong could go after the Cardinals in an efficient, relaxed manner because he was pitching with a cushion. The Giants got a run off Carpenter in the first, and when the Cardinals made one mistake in the second — shortstop Pete Kozma’s error with one out and two on — San Francisco pounced. Marco Scutaro smashed a two-out, two-run double, Pablo Sandoval followed with a run-scoring single and the Giants led 5-0. AT&T Park rocked, and Vogelsong hadn’t yet sent them into a frenzy.

Said Vogelsong: “When I’m standing on the mound tonight, and they’re chanting ‘Vog-ey!,’ it just makes you want to get the job done for them.”

How much of this performance grew from his road here is impossible to say. What’s not is that he waited a long time for a moment like Sunday’s. Originally drafted by the Giants in 1998, he made his major league debut with San Francisco two years later. But in the summer of 2001, he was traded to Pittsburgh. Thus began his odyssey.

He pitched two games for the Pirates before he required Tommy John surgery. He lost his first 11 major league decisions. His first full season as a starter, 2004, he went 6-13 with an ungodly 6.50 ERA. His ERA for his five seasons in Pittsburgh: An even 6.00. That led to three seasons in Japan, from whence players seldom return.

Somehow, Vogelsong did. It took stints in the minors with three teams, the last the Giants. But he got back. How, exactly, is hard to say.

“A lot of faith, a lot of hard work,” Vogelsong said. “. . . Weird things have to happen that are much greater than us for things to work out like this.”

The past two seasons with the Giants — in which he went 13-7 and 14-9 — are the only times in his major league career in which he has won more games than he lost. Now, he has three postseason starts. He has given up only a run in each. He is 2-0 with a 1.42 ERA.

“You understand how this game can humble you,” Affeldt said.

Pittsburgh? Japan? The minors? Vogelsong’s process didn’t particularly matter to the city of San Francisco on Sunday night. What mattered: When the happy fans filtered out into the streets, they knew they had another day to play. They had Ryan Vogelsong to thank.