Sen. Edward M. Kennedy (D-Mass.) has hit the campaign trail this fall as gatekeeper of his brother's legacy.

"I'll travel across the country in this campaign to say," he roared here to a Mexican-American audience of more than 1,500, "that Ronald Wilson Reagan has no right to quote John Fitzgerald Kennedy."

The rousing declaration of no trespassing drew a standing ovation here in the Rio Grande valley and at stops in Houston, San Antonio and Austin during a three-day Texas swing last week. By Nov. 6, Kennedy will have carried the same message to 20 states.

In the closing weeks of the presidential campaign, when the Walter F. Mondale-Geraldine A. Ferraro ticket is doing all it can to activate its Democratic voter base, Kennedy is emerging as one of the party's most effective surrogates.

No one draws such big crowds on his own, tub-thumps the Democrats fight songs with more relish or brings better credentials to the task of stirring partisan resentment to Reagan's habit of quoting Democratic presidents Kennedy, Harry S Truman and Franklin D. Roosevelt.

"As I remember -- and I do -- Ronald Reagan was a Democrat for Richard M. Nixon in 1960 . . . . So I have a simple question: 'I wonder why Reagan doesn't quote Nixon now?' "

Kennedy posed the question in a mock-serious, almost self-parodying taunt, and it broke up his audience with laughter.

In his performance on the stump, the Kennedy of 1984 invites comparisons to a championship boxer working a few exhibition rounds.

He's thick around the middle, his face is a bit blotchy and his timing is sometimes off, but he's loose and hammy, and the crowd loves it.

He goes after Reagan with a needle rather than a knife.

"Maybe the president finds it so easy to flip-flop because he finds it so hard to remember," Kennedy says in his standard stump speech -- a remark that is as close as he gets to raising the age and mental-acuity issue that Reagan reopened last week with what was widely viewed as a faltering performance in the first televised debate.

The rule of thumb in presidential races is that surrogates do the cutting and slashing, but Kennedy said he has "no intention" of getting any more frontal in his attacks on the president's competence.

"He's never been comfortable using the hatchet," said Kennedy's speechwriter, Robert Shrum.

In addition to lobbing familiar Democratic broadsides against Reagan on Social Security, fairness, education and arms control, Kennedy takes a few swipes on what for him is unfamiliar terrain. On the subject of deficits, he says with a clear appreciation for the irony of the observation: "The truth may hurt but this is it: Ronald Reagan is the biggest spender in American history."

Kennedy also devotes a section of his speech to outlining his efforts on behalf of crime control, and he talks of the "realism" that guides his approach to government programs.

"As Democrats, we do not favor government for its own sake, programs for their own sake or spending for its own sake. And we will not permit the Republicans to set a double standard. We believe that when a housing program fails, it should be changed or abolished. But we also believe that applies on every side: when a new pinpoint guidance system for our missiles repeatedly misses its target in field tests, then the weapon should be changed, or the funding should be cut or ended."

Kennedy's itinerary, which has been set largely by the Mondale camp, will take him to California, Illinois, Michigan and most of the East Coast states in the next three weeks.

Any Kennedy trip inevitably raises questions about his presidential intentions. He took himself out of the 1984 race last year, citing family reasons.

Aides say he refuses to talk about 1988, but they acknowledge that the hiring of Texan Robert Mann as his press secretary is the latest move of a politician who knows he must broaden his base into the South if he is to become a successful presidential contender.

On the Texas trip, Kennedy struck up a good relationship with Gov. Mark White (D), who comes from the party's moderate-conservative wing. Kennedy's aides were pleased at the number of Tory Democrats who turned up to meet him at a reception in the governor's mansion in Austin.

On the other hand, Democratic senatorial candidate Lloyd Doggett was absent from all of Kennedy's appearances. His Republican opponent, Rep. Phil Gramm (R-Tex.), has been belaboring Doggett as a "Kennedy Democrat."

Kennedy chose to tread lightly over his support for Doggett. "Do you know that Lloyd's opponent has even suggested he's so bad that in the Senate he might sometimes agree with me?" he asked his audiences. "The real truth is -- Lloyd Doggett and I are going to have our disagreements."