Baseball's Tar Wars came to an end today with the New York Yankees, their sport's equivalent of The Empire, routed on all fronts.

New York not only lost a game and a convoluted court fight, too, but the Yankees were also outsmarted and embarrassed by American League officials when the Bronx Bickerers unveiled an exotic protest they'd been plotting. Even a thunder and lightning storm bypassed Yankee Stadium at the last moment as the Yankees' final hope for a stay of execution disappeared.

Let the baseball ledger show that Kansas City reliever Dan Quisenberry needed only 10 pitches to retire the Yankees in order in the ninth to save a 5-4 victory for the Royals in a resumption of their famous pine tar-bat battle of July 24.

"It was the consummate ending. Everyone will live happily ever after," said Quisenberry, who got Don Mattingly and Roy Smalley on opposite-field fly balls and Oscar Gamble on a grounder to second base for his 33rd save.

This infamous game, which the Yankees thought they had won 25 days ago when umpires nullified a two-run, two-out home run by George Brett in the ninth, took only 12 minutes to complete. It was witnessed by a tiny crowd, generously reported as 1,245 by the Yankees.

This day's unquestioned highlight came when Yankee Manager Billy Martin scampered onto the field before the first pitch at 6:06 p.m. He had a scheme.

His pitcher--George Frazier--had appealed at both first and second base, contending Brett, on that bygone day, had neglected to tag one of those bags after hitting his homer with that illicit pine tar-laden bat.

The Yankees had noticed a new umpiring crew was working the remainder of this game. Joe Brinkman's crew was gone, replaced by that headed by Dave Phillips.

How can you refuse our appeal when you guys weren't even here at the original game, Martin demanded of Phillips? How do you know whether Brett touched the bases? We're going to protest this game, continued Martin.

That's when Phillips laid it on him. From his pocket, with no change of expression, Phillips drew a piece of paper. Slowly, he unfolded it. This, the umpire informed Martin, was a notarized letter, signed by all four original umpires, stating Brett and the man on base, U.L. Washington, had, in fact, touched every base.

"We expected that the Yankees would pull something like this," said American League official Bob Fischel. "We were ready for it."

And Martin and the Yankees had more egg on their faces before a pitch was ever thrown. The Yankees lodged their protest, anyway. Could the New York front office have a leak, or has league President Lee MacPhail planted a mole?

"Whoever figured out what the Yankees were going to do, and then outfoxed them, should be the next commissioner of baseball," said Quisenberry. "The search is over. Brilliant."

The notarized letter was just the end of a bad day for the Yankees.

Earlier, a Bronx Supreme Court judge had issued an injunction ruling that the game could not be finished until there was time to try the merits of two class-action lawsuits filed by disgruntled fans.

However, in mid-afternoon, Justice Joseph P. Sullivan of the New York State Supreme Court Appellate Division for the First Judicial Department stayed that ruling by Justice Orest V. Maresca. "I guess I can state it best in two words," said Sullivan. "Play ball."

"The Yankees will abide by the judge's decision," said George Steinbrenner, the Yankees' owner, in a prepared statement. " . . . We resent the implication by the American League office that we had any part in either lawsuit . . . We will seek remedy against the American League officials who so stated."

Before this game, Martin, who refused comment afterward, was at his surliest and more boorish. The Yankees had a black, hand-carved bat on their dugout steps; its barrel was covered with gobs of shaving cream. "That bat is legal," snapped Martin. "Shaving cream is not illegal."

Martin, asked by an NBC-TV reporter how this pine tar situation had hurt the team, responded viciously: "Losses. L-O-S-S-E-S. Can you spell that?"

The fifth-place Yankees have lost six of seven games and are 3 1/2 games out of first in the AL East.

The subject of the original controversy wasn't even at Yankee Stadium this afternoon; Brett stayed at Newark Airport waiting for his teammates to fly to Baltimore for a weekend series. MacPhail, who overruled his umpires and decided that Brett's home run should stand because that was "the spirit of the rule," sat near John Schuerholz, the Royals' general manager.

Aside from Martin, Schuerholz may have been the angriest person here. He was incensed by the court cases, which he said he assumed were instigated or orchestrated by the Yankees. And he was mad at the Yankees' playing the last out of the top of the ninth today with Ron Guidry in center field and Mattingly, a first baseman, at second base.

Quisenberry, appropriately, had the final word. "We've already been to New York twice this year," he said. "I've seen everything I wanted to see here, eaten at the delis. Oh, I'd like to get a piece of cheesecake for the road, but, otherwise, I really didn't need to come back to New York."

Asked if this day was a piece of history, Quisenberry yawned and said, "It may be bigger than the World Series."