As Hindu-Moslem violence continues sporadically in the northeastern state of Assam, Prime Minister Indira Gandhi's government is becoming resigned to the prospect of reimposing federal control in the state.

A new state government--based on the results of last week's elections for the state legislature--was sworn in tonight as paramilitary forces stood guard outside the Government House amid uncertainty about how long it would remain in office.

The new legislature--dominated by Gandhi's Congress (I) Party--was elected amid communal massacres that turned the lush Brahmaputra Valley into a medieval nightmare. Officials are hinting that if the violence is not to spread to other insurgency-prone states, some sort of central control must be applied in Assam. NEWS ANALYSIS

Fourteen new instances of communal violence were reported today as two persons were killed and at least 50 houses burned in central Assam.

A reluctant acknowledgment that the democratic process in Assam has been compromised is emerging as leaders of the extremist ethnic movement warn that they are ready to begin a second phase of their battle.

Their objective is to strike from the electoral rolls nearly 4 million Bengali-speaking Moslem immigrants from Bangladesh and expel nearly a million of them to surrounding Indian states. The spread of violence during the past three weeks demonstrated wide support among indigenous Assamese, including tribesmen in remote regions of the state, for the movement's aims.

The threatened second phase would be a paralysis of life throughout Assam and violent confrontations in the state capital, Gauhati, and elsewhere aimed at preventing the elected government from functioning.

Since the turbulent elections that Gandhi insisted upon holding may have been only the start of communal violence, the government appears likely to employ a constitutional provision to reimpose the central rule that has governed Assam for the past year.

The state assembly that was elected by a meager turnout of voters is to be installed by March 19. Constitutionally, it could then be immediately dissolved. The same kind of one-year "president's rule" that was imposed last March following disturbances would be declared in Assam, giving the Gandhi government breathing room to resume negotiations with the student-led ethnic movement about the status of the immigrants.

The All-Assam Students' Union and 10 other mostly professional organizations that have led the protests for three years had said they preferred an extension of central rule to the election, in which Congress (I) won an absolute majority.

While that strategy would merely defer a resolution of the ethnic movement leaders' demand to disenfranchise and deport the immigrants, it presumably would calm passions in Assam and, some government officials feel, stem the carnage that has swept across the state.

What is emerging from Assam is a growing awareness that the massacres are less a direct result of the political controversy over the holding of state elections than they are an outlet for rage that has been building since partition of the Subcontinent in 1947--and even as far back as the turn of the century.

The seven northeastern states and territories connected to the rest of India by a narrow land corridor traditionally have been outside India's dominant cultural stream.

Because the region, which was subdivided into smaller states in the 1960s and 1970s, had a marginal Hindu majority and not enough Moslems to be incorporated into then East Pakistan, it was made part of the Indian union when the British drew the new Subcontinent map.

But even before partition, the genesis of the current conflict was beginning to take shape, starting with an influx of immigrants into Assam from the eastern part of Bengal in the early 1900s.

Assam was incorporated into imperial India by a 1826 treaty between the Burmese and British. In 1931, a British census superintendent, C.S. Mullan, foresaw the danger posed by Moslem immigration from what became East Pakistan and is now Bangladesh, and warned of a growing demographic imbalance.

Further immigration by both Hindus and Moslems from East Pakistan following partition was compounded by fresh waves of refugees to Assam during the Bangladesh war in 1970-71, reaching a point where the indigenous Assamese felt threatened by what they call the "foreigners."

The inclusion of "foreigners" on the electoral rolls led to a widespread boycott of the 1980 election by indigenous Assamese, and the student-led ethnic movement has since been agitating for a revision of the voting lists and the expulsion of illegal immigrants who arrived after 1961. The Gandhi government had proposed that foreigners who illegally entered Assam after 1971 be stricken from the electoral rolls and that steps be taken to deport them.

When protracted negotiations, some attended by Gandhi, broke down, the prime minister announced that the elections would be held despite threats of widespread violence.

Her opponents in Parliament have said the decision was based either on a miscalculation of the potential for massacres or a cynical attempt to exploit an opportunity to lead the Congress (I) to an absolute majority in Assam and pick up a few seats in the parliamentary by-election there.

Stung by such criticism, Gandhi has said she could not have foreseen the scale of violence that accompanied the election and that the only alternative would have been to yield to an extremist pressure group that openly sought to subvert the democratic process. That, the prime minister said, would encourage militancy by other regional or separatist forces.

Some Indian analysts have suggested that in the wake of recent election defeats to regional parties in two southern Indian states, Gandhi may have felt that her political prestige could not absorb another setback, even though Congress (I) controlled or shared control in 15 of India's 22 states.

If she reimposes central rule in Assam, as expected, she will still have on the record a Congress (I) majority there, and can, when order is restored, revive the elected legislature anytime during its five-year term. Her party won 90 of the 126 seats in the state assembly.

Because of the remoteness and inaccessibility of many of the villages destroyed in the nearly three weeks of massacres, it is uncertain how many lives have been lost. Foreign journalists have long been banned from Assam, part of India's strategically sensitive border region, and Indian reporters have been unable to travel to some stricken areas where roads and bridges have been cut off by marauding raiders.

Unofficial estimates run as high as 2,500 to 3,000 dead, many of them along a stretch of 60 miles in the central Nowgong district. Hardest hit was the area of Nellie, scene of a massacre by tribal raiders in which at least 500 Moslem immigrants were killed by raiders with spears, bows and arrows and machetes on Feb. 11 and 12.

The violence has revived troubling questions about India's stated aim of achieving "unity in diversity," and has posed new challenges to Gandhi's resolve to steel the state against the centrifugal forces generated by a vast array of cultural, ethnic and linguistic communities.