Perhaps when winter comes and the bats and gloves have been stored, it will turn out that the three games played in Shea Stadium this week between the New York Mets and St. Louis Cardinals will have meant nothing.

Perhaps second baseman Tommy Herr of the Cardinals will be proved right: "The pennant," he said today, "won't be decided in these games. It will be decided when we both play the noncontenders."

If so, what a shame. Because as the baseball fans of an entire city sat riveted for 48 hours, the Mets and Cardinals played three games rife with all those wonderful things that make people wax eloquent about the sport.

Today, the final glory belonged to Keith Hernandez. His opposite-field single in the ninth inning scored Mookie Wilson from second base to give the Mets a 7-6 victory before 46,295 fans, many of whom had watched in disbelief as the Mets blew an early 6-0 lead.

"If they had come back and won this game, it might have carried them for a long time," said Hernandez, who set the NL record with his 22nd game-winning RBI. "If we had lost, well, it would have been a real test of our character."

There is little to question in the character of either of these teams after these three games, each decided by one run. The Mets won the first, 5-4, then lost the second, 1-0. The teams leave town with the Mets one game ahead of the Cardinals in the National League East but knowing how narrow their margin was in both victories.

"We really had to have this one," said Manager Dave Johnson of the Mets. "I'm not saying it would have killed us with 24 games still left, but it would have hurt."

It would have hurt because this one started out as a walkover. The Mets got four runs in the first and two more in the second off 20-game winner Joaquin Andujar.

With their speed, the Cardinals never are out of a game. Quickly, they chipped back, getting three runs off Ed Lynch in the third and two in the fourth. It was 6-5 and suddenly the day darkened for the Mets.

"I think we showed them something," said Cardinals center fielder Willie McGee. "It would have been easy for us to lay down trailing by six, but we're not like that. We always think we can come back."

McGee is one of the major reasons the Cardinals think that. He came in today batting .360 and was three for five, including a ninth-inning home run off Jesse Orosco that tied the score at 6. That came after relief pitchers had shut the Mets down from the third inning on and after Orosco had come on in the eighth to get pinch hitter Brian Harper to ground into a double play.

"When Jess got us out of that jam, I thought we had the game won," Johnson said. "He was throwing the ball very well . . . "

Orosco (6-5), the winner today, has become baseball's answer to Las Vegas and Atlantic City. Every time he comes in, it's strictly a dice-roll for the Mets.

Sunday, in Los Angeles, he gave up a home run to Mike Marshall, blowing New York's lead. Wednesday, he broke up a 0-0 pitching duel with a slider that Cesar Cedeno hit for the game-winning home run. Today, after his strong eighth, he began the ninth by getting Vince Coleman, who bunted to third baseman Howard Johnson.

That brought up McGee. "I'm just looking to drive the ball in that situation," he said. "He threw a pitch up, one that I often pop up. But this time I got it."

He got it over the center field fence as Orosco, booed when he came in, heard still more boos. The 6-0 lead of midafternoon had become a 6-6 tie.

"We needed a quick lift," Wilson said. "I felt like I had to get on, somehow."

He did. Jammed by one of Ken Dayley's good fast balls, he hit a chopper past the mound. With his speed, he will beat the play most times. But the St. Louis shortstop is Ozzie Smith, the man who has virtually reinvented the position.

"I've made the play a million times," Smith said. "People expect too much of me. If I make it, that's a super play. This time, I didn't."

He got to the ball quickly enough but threw into the dirt. Harper, in at first, couldn't scoop it. "If the first baseman catches the ball," Wilson said, "I'm out."

Instead, he was on first with what was ruled a hit. A moment later, he was on second, because Wally Backman, the Mets' best bunter, sacrificed perfectly.

Now, it was Hernandez's turn.

Dayley got a strike with a fast ball inside. Then he threw a fast ball outside. "I just went with it," Hernandez said. "I didn't hit it hard, but that doesn't matter."

As soon as the ball left Hernandez's bat, Wilson, the fastest Met, was off. He never stopped rounding third and any chance Coleman had in left of a miraculous throw was lost when he couldn't handle the ball cleanly. The Mets rejoiced.

They will meet again three times beginning Oct. 1 in St. Louis. Maybe by then Herr will have been proven right. But don't bet on it.