Ronald Reagan has been given a lot of "out to lunch" environmental advice, has no coherent program, and will be strongly pressed by "the rape, pillage and burn crowd" to do things he might later regret, according to outgoing Environmental Protection Agency administrator Douglas Costle.

At 40, Costle is tired. His four years of running EPA have been spent in the crosshairs of most of Washington's big guns, and he is glad the dodging is almost over.

"My successor has my total sympathy and empathy," he said in a recent interview.

President-elect Reagan, he said, has proved himself so ignorant about most environmental issues that educating him will be the new EPA chief's main task.

"There will be a struggle for the soul of this administration by the rape, pillage and burn crowd on the one hand and the moderate, conservative pragmatists who are building for the future on the other," Costle said.

He declined to name names in the first category, but said it included "members of a number of industries with very special agendas -- the auto industry, coal and steel. Some of them exercise more prudent judgment than others."

The grouping includes some of EPA's worst enemies, he added, who have advocated that EPA be disemboweled and most of its research and standard-setting functions distributed to other agencies and to the states. One such advisory report, from the conservative Heritage Foundation, is "out to lunch, totally impractical," Costle said.

"None of the states have enough research capacity to set standards," Costle insisted. "It's tough enough for the federal government to get enough science together to do it . . . . They're coming at it from a know-nothing posture."

In addition, he said, the whole point of federal standards was to eliminate pollution control as an area in which states could compete in attracting industries.

"What would keep Mississippi from setting a more lenient standard than Pennsylvania in order to lure Pennsylvania industry?" he demanded. The answer is that nothing would, but the Heritage advisers have said that if states want dirty air that is their option. Costle called this "nonsense."

Battling such attacks will require that the new EPA chief "remember that the business community is going to have friends in court. They always ask for an extra inning," Costle said, adding that the new EPA head is "going to feel kind of lonely if he doesn't have a pretty good understanding with the boss. He's got to be able to cut through the White House staff and get through."

Costle said his own relationship with President Carter was excellent and he feels that Carter "delivered reasonably well" on his promise to be an environmentalist president.

"I'll save my opinion of the White House staff for my memoirs," Costle said.

He is known to have fought with domestic counselor Stuart Eizenstat over coal-related interpretations of the Clean Air Act and with Office of Management and Budget people over toxic waste cleanup spending. He insisted, however, that he won most of the battles and that Carter would be remembered as "the most environmentally conscious president we've ever had in this country."

Costle's conversation at the end of a long day in his airy office was full of the metaphor of struggle.

"Four years of this is a grind," he said. "Everybody's got their knives out for you."

Costle said Washington trade associations and lobbies "are in hand-to-hand combat in the trenches" and often lack the perspective of more cautious out-of-town corporate executives -- the pragmatists in his equation. The lobbists "smell blood in the water when they look at the new Congress and they want red meat . . . but the executives have a sense that if they push the pendulum too far, too fast, it'll just snap back at them with a vengeance."

The position Reagan takes on the rewriting of the Clean Air Act this spring will be an early indicator of which side is winning, Costle said. The law requires that new regulations on sulfur dioxide emissions, particle counts from smokestacks, and carbon monoxide standards be issued early next year and this will allow the new EPA to show its colors, he said.

"They're going to have to get down and grub around in the facts," he said. "To the extent they try for constructive solutions. I'll be applauding from the sidelines."

Costle has not decided on his own future, although there have been offers from his old law frim in Connecticut, where he was state environmental protection commissioner before coming to Washington. He was in on the formation of EPA, writing a 1970 White House study that recommended such an agency and then helping to get the legislation through Congress.

Now, he said, the incoming administration "would be making a serious mistake" if it tries to gut environmental laws. Polls show continuing support for strict pollution controls, he said.

"I've watched the professionalism grow," Costle said. "We haven't had a bunch of environmental shock troops running around . . . . Either you're good or you don't survive, because everybody's got their knives out for you."

Many regulatory changes being proposed already have been launched at EPA, he said. The nation's air and water are cleaner now than in 1976 and the agency has been oriented toward The critical environmental problems of the 1980s and '90s, which are toxic chemicals," Costle said. He is proud of performance standards for new pollution sources that "make it possible to burn coal in this country."

Among Costle's regrets is the September crisis at the Love Canal toxic waste dump in New York. He said that a consultant's study showing genetic problems among residents "wouldn't have been released when it was if the press hadn't got hold of it. Then the White House had to order it out."

The release triggered panic among the residents, and Carter declared a state of emergency. Costle said he would have waited until more peer review of the study was available.

Throughout the Carter years, Costle reflected, he never had enough time. He appeared 175 times before 66 different congressional subcommittees last year, and was so exasperated by unending calls to the Hill that he had a chart made showing appearances by himself or his department chiefs. T is a huge, berserk tangle of red and blue lines.

"You win very few victories," he concluded. "It's just varying degrees of defeat."