Nicaraguan military leaders, facing resumption of aggressive rebel assaults, say they are making effective use of Soviet-supplied helicopters and also plan to mobilize thousands of troops in response.

To counter such tactics as recent hit-and-run attacks on two towns in the interior, Sandinista officers say they are building up their territorial militia forces that are deployed as the first line of defense.

The Sandinistas argue that the rebels, deprived of support in the countryside by earlier evacuation of rural families to urban areas, now have little choice but to attack the towns and to extend their supply lines to other areas. The military says its strategy is to defend the towns and to patrol the countryside with militia -- and then to have the regular Army respond quickly to an attack.

In the recent engagements, the rebels overwhelmed the ill-prepared local militia and then ambushed Army reinforcements before withdrawing or being chased away by heavier Army mobile strike teams. The contras seem to have tried to avoid direct engagements with the regular Nicaraguan Army and counterinsurgency battalions.

After an initial spate of attacks, the contras, as the rebels are known here, appear to have withdrawn to the hills -- where the Sandinistas report half a dozen encounters with them. Nicaraguan officials say they have detected a contra resupply effort under way and expect new attacks soon on towns.

"We will mobilize thousands of men in the next weeks and months because only with the people massively mobilized will this war end more rapidly," Defense Minister Humberto Ortega told journalists last week.

Ortega and other military leaders said their ground forces were working in a more coordinated and effective manner with the helicopters. Although the Sandinistas were stung by two recent rebel surprise attacks on towns in the interior, these military officials insisted that their ground troops, with the help of the copters, had made the rebels pay heavily for the headlines they grabbed with their raids.

Western diplomats here were calling the prominent role played by the Mi8 helicopters -- which are used to fire rockets as well as to carry troops -- and the initial use of Mi24 helicopter gunships in recent fighting an important change in the nature of the three-year-old war and a significant upgrading of the Sandinista Army.

The mobilization of more men and the use of the helicopters seem to ensure an escalation in the fighting here. The Sandinistas are saying it is all part of a plan announced early this year to deal the rebels a crippling blow by the end of 1985. But observers consulted here said that outcome was unlikely.

On Aug. 1, forces of the Nicaraguan Democratic Force, which has been U.S.-funded in the past, entered the town of La Trinidad on the country's major highway, 80 miles north of Managua. The next day, another column entered Cuapa, about 80 miles east of the capital. The rebels besieged the militia headquarters in both towns, dominating outgunned local militiamen. The forces spent about four hours in each town and killed at least 65 Sandinistas.

The rebels also damaged three bridges with explosives, two on the country's main highway, and ambushed and killed 29 Sandinista soldiers just three miles from that highway in what was the rebels' most effective week in more than three years of fighting.

Sandinista officials, although they admitted the contras had shown more daring and better coordination than in the past, minimized the importance of the raids.

"The attacks have been of little military value," said Lt. Cmdr. Adolfo Chamorro, who is headquartered here as chief of staff for the five northern provinces that are the principal theater of the war. "They have not faced the Army or dealt it a defeat and have not been able to stay in the areas they have attacked because they have no social base there. They are once again on the run."

Sandinista officials said they had captured about 60 contras, 32 of whom they presented to journalists. The officials said more than 100 rebels were killed. Journalists were unable to verify that figure independently.

Sandinista officials said they expect the contras to continue to try to operate closer to towns, not only because of the propaganda value but because in some areas they no longer have much choice. The officials cited evacuation by the government earlier this year of rural areas, where the rebels once could get food, information and recruits.

Cmdr. Luis Carrion, who is on the nine-man National Directorate of the governing Sandinista front, has been assigned to oversee all political and military activities in the five northern provinces. He said at a press conference last week that contra aircraft had been detected dropping supplies to rebels in rural areas and that he expected increased rebel activity soon.

Last week, government media announced the mobilization of two reserve battalions. There are thought to be about 20,000 reservists, some of whom already were on active duty.

There was no mention of reviving the draft, which was suspended in April. Some draftees are due for release late this year and many more in January.

Lt. Cmdr. Chamorro said the Army had mobilized extra territorial militia to meet the new contra threat and that group would continue to be the first line of defense. The government will not reveal the number of such militia, but diplomats and journalists here estimate that there are 50,000 to 70,000 -- holding other jobs but patrolling their towns and cities at night. They often are mobilized, sometimes for months at a time, to patrol the mountains around those towns.

This militia often has been poorly trained, sometimes armed with vintage rifles, and could not be depended on to hold ground against the rebels, according to some Sandinista officers.

Some militiamen still fit that description, but many now carry newer Soviet-designed AK47 automatic rifles, wear camouflage uniforms and new boots, and receive military training. Sandinista military leaders say that with regular Army officers now leading them, the militiamen are much better fighters.

Some of these militiamen have been added to outposts that are obvious contra targets, such as at bridges, power stations and government granaries. Others are mobilized in the mountains.

"What the militia means to the contras is that in the mountains there is no trail on which they are safe, and in the cities they can be shot on any street, from any doorway," said Chamorro.

With the militia in charge of protecting specific areas, regular Army forces, special counterinsurgency troops and internal security troops continue to roam the mountains, stalking the rebels wherever they show up, said the officials. Those forces are thought to total about 50,000 men.

Cmdr. Manuel Salatierra, who directed the counterattack against the raiders at La Trinidad, said his ground troops were in direct radio contact with attack helicopters, and that resulted in many enemy casualties.

"The helicopters make a big difference," said Cmdr. Roberto Calderon, chief of the southwest military region that includes Cuapa. "It is not the same to walk four days . . . as it is to get off the helicopter and go into combat. Our troops are fresher, better."

Sandinista ground troops also are receiving support from artillery and "Stalin's Organ" rocket launchers -- with a large supply of ammunition from the Soviet Bloc.

Rebel leaders are saying they have at least 10,000 men in the country and hope soon to have more than 20,000.

"They say they will have that many men because they want to get more money" from the United States, said Chamorro. "There is no way they can get that many men. From where? And if they really have 10,000 men in the country, let's see them do something big."