A police patrol through the tropical lowlands around this small town in eastern Peru is like an invasion of a rich, peculiar and unerringly hostile new world.

Here in dense fields of high grasses and palm forest, an intruding squad is confronted with hillside after sweeping hillside of small, light-green coca bushes, the raw material of the region's booming cocaine traffic.

Up along the ridges are tiny shacks of wood poles and palm leaves where small farmers and their families seem to endure the worst of poverty. Yet inside their homes are battery-operated stereos and imported American furniture, and on the reddened car track below, a gleaming Toyota Corolla, a Volvo station wagon and a Honda Firebird motorcycle can be passed in half a mile.

The police themselves carry Argentine-made automatic rifles and drive a powerful Cherokee jeep bought and delivered by the U.S. government. For this is one of the centers of South America's cocaine country, and the Peruvian police in Tingo Maria are part of the most ambitious program yet launched to halt the cross-continental traffic.

For the past few months, jeeps, radios, tools and heavy equipment have been pouring into this town and the long upper Huallaga Valley above it, and American technicians, diplomats and Drug Enforcement Administration agents have been shuttling in and out on planes from Lima.

In the next four years, about $26.5 million in U.S. grants and loans will be pumped into this area. The special Peruvian drug control force created here with U.S. guidance will be expanded to 300 men and 54 agricultural agents will open shop along both sides of the Huallaga River.

The object is simple and yet staggering: to persuade or force the 17,000 coca farmers in the region to give up their 35,000 acres of coca and plant a less lucrative crop.

Coca farmers here will be paid to root up their own hillside fields. Government agents will offer them advice on new crops to plant and give them small loans for equipment or seeds. Meanwhile, police will crack down on anyone who shuns the offers.

This plan is at the center of the Reagan administration's strategy of combatting U.S. cocaine abuse by eliminating its sources in South America. As the U.S. demand for cocaine has grown in the past 10 years, a vast society of growers, financers and traffickers has sprung up in poor or newly developed areas of Bolivia, Peru and Colombia, and whole chunks of territory have been virtually annexed from legal government by this new drug kingdom.

As the U.S. and Peruvian governments have begun to implement their joint five-year program in the upper Huallaga Valley, U.S. officials in Bolivia have spent most of this year seeking to negotiate a similar agreement with Bolivia for $77 million in U.S. aid to develop growing areas and shift them to other crops.

No one believes that the programs will succeed in ending illegal coca growing or trafficking. Rather, U.S. officials optimistically speak of making the problem "manageable" over five to 10 years.

Yet, even this goal is questioned by some of the local governments drawn into the coca battle with the United States.

"Even if we eliminate the coca here, it will simply move and the coca production will increase somewhere else," said Guillermo Thornberry, the head of Peru's narcotics control coordinating office. "No one is going to run the risk of making drugs for consumption in Peru. But as long as there is demand in the United States, it is going to be impossible, or very difficult, to eliminate the traffic."

"The principal problem is in the United States and not here," said Rodrigo Escobar Navia, minister of government in Colombia. "The United States should ask themselves why they have so much cocaine, why they haven't been effective in reducing demand, and if repression of the traffic is really the best road to take. Human problems just don't present themselves in such simple terms."

So far, the efforts of South American and U.S. officials to curtail the cocaine traffic in some areas have seemed only to worsen the problem, while in others, limited campaigns have simply failed.

Two years ago, for example, the Peruvian Army moved into the upper Huallaga Valley and spent several weeks rooting out and burning coca fields and arresting their owners in an operation called Green Sea. The result was publicity and attention, but the coca fields returned and expanded as soon as the Army left.

In both Peru and Bolivia, officials concede that some ill-trained police have turned to corruption once they were put in the field. In other areas, dozens of abuses by local authorities have caused communities to reject government efforts to win cooperation against the traffickers.

The resentment of what in Bolivia has come to be known as "the other Mafia" of police enforcers has been exploited by cocaine traffickers to organize their own security armies and drive government forces out of entire zones. In Colombia, coca growers have even arranged to be defended by insurgent guerrilla groups, who in exchange for money or arms force police to seek the assistance of the Army before entering trafficking zones.

Meanwhile, cocaine interests have won some political support with public relations campaigns arguing that coca production is a healthy native tradition and that enforcement efforts represent heavy-handed U.S. imperialism.

The result is that U.S. and local officials are now beginning new programs in these countries with an already-tarnished public image. "There has been a complete loss of prestige by the drug authorities and police among the common people," said Alberto Canales of the Bolivian government drug control council. "No one will want to trust anything that is done."

The worst enforcement problems have developed in Bolivia, the source of between one-third and one-half of the U.S. cocaine supply. There, the cocaine industry expanded and flourished until recently under a corrupt military government, and enforcement police frequently have been accused of terrorizing the countryside they are supposed to patrol.

Both U.S. and Bolivian officials acknowledge that police have committed abuses and alienated the populations of the coca-growing regions. It has been the general failure of sheer muscle in Bolivia and Peru that has helped prompt the new programs of aid and crop substitution, the officials say.

"The only way to have control in Bolivia and Peru now is to involve the farmers themselves in it," said Edwin Coor, U.S. ambassador to Bolivia and a designer of the new programs in Bolivia and the upper Huallaga Valley of Peru. "Enforcement itself is not a solution. Farmers have to realize that they can have a better way of life."

In Peru, officials say that the five-year plan signed in September 1981 has fallen well behind schedule because of U.S. bureaucratic delays and infighting between the Drug Enforcement Administration and the Agency for International Development, which only reluctantly agreed to join the project.

Officials also say that many farmers targeted for the project have been alienated by police excesses. In recent months, there have been at least three incidents of Peruvian police going on robbing sprees in farming communities, a local commander said.

In Bolivia, officials say they hope to reach agreement on the coca control program with the new government of President Hernan Siles Zuazo by the end of the year. But political trouble has arisen after a public-relations campaign by coca growing and trafficking interests, who placed a program on state television in September denouncing the U.S.-backed control efforts.

Meanwhile, enforcement officials say coca plantings are increasingly spreading to Colombia, where most of the large trafficking organizations are based. This means that Bolivian and Peruvian plantings may no longer be important to the cocaine trade by the time the new U.S. programs are complete.

"The basic problem is that Americans have a strong urge to ingest harmful substances," one diplomat observed. "And until that changes, somewhere down here there will be an industry to serve it."