On Sunday night, in the fifth inning of what was supposed to be the climactic game of the World Series, St. Louis Cardinals manager Whitey Herzog found himself in the middle of an unseemly rhubarb and about to be ejected for the night. His best pitcher, John Tudor, had been relieved a short time before and had then gone and rammed his hand into an electric fan. Now on the mound was the irascible Joaquin Andujar, warming up for a mad scene that would have done credit to Maria Callas. Things were sliding out of control, and it was time to think in terms of some horrible precedent's being set, perhaps on the order of losing a World Series game by 23 runs.

Where, Mr. Herzog might have wondered at that moment, had things gone wrong? Was it two weeks ago, when an automatic tarpaulin emerged from under the synthetic turf of Busch Stadium and ran over the leg of the Cardinals' great base stealer and outfielder, Vince Coleman, eliminating him from World Series competition? Or was it way back when baseball agreed to expand the playoffs to best-of- seven games in 1985, thus providing the Kansas City Royals with the opportunity to overcome a 3-1 deficit against the Toronto Blue Jays and win the pennant?

Or could everything be blamed on that call by the umpire at first base Saturday night that kept alive a stunning come-from-behind Royals' rally in the ninth inning of the sixth game? Maybe. But Mr. Herzog might just as well have recalled another nightmare vision from that same inning: the sight of his first baseman and catcher standing at the steps of a dugout looking at each other while a crucial foul pop-up fell untouched.

Better to say the Cardinals' troubles of Sunday night began nearly a decade ago when the Kansas City Royals started winning championships in the western division of the American League. In the late 1970s they were the team that the Yankees beat regularly for the league pennant. The Royals lost some tough playoff series, but they learned. In 1980 they finally beat the Yankees, then lost the World Series.

Although this year's team seemed diminished in talent from some of those earlier ones, it still had the likes of George Brett, Frank White and Hal McRae around, old hands who had seen a lot. Down three games to one -- twice -- the veterans spread the word that the pressure was on the other team not to blow its lead. In that no-panic atmosphere, the Royals' young pitchers -- foremost among them Bret Saberhagen -- performed like junior Koufaxes, and some unheralded batters got big, or small but timely, hits.

Mr. Herzog in his agony could also have reflected on the fact that last April his Cardinals were expected to finish last, that they went on to win more games than any team in baseball, tha they faced down the Mets and the Dodgers and that they barely missed winning the World Series despite a horrendous batting slump. He might have taken some solace in the knowledge that a good team was losing to a good team, even if the final score was 11-0.