Thousands of Indians began marching early today to join the funeral procession for Indira Gandhi against a backdrop of religious violence and political discord.

The leaders of India's opposition parties attacked newly installed Prime Minister Rajiv Gandhi yesterday, accusing him of failing to control the violence that has swept the country following his mother's assassination.

As the official death toll in sectarian rioting climbed far beyond the government's official totals -- unofficially as high as 750, with 500 reported dead in New Delhi alone -- and mob rampages continued in many states, Gandhi appealed in a surprise television broadcast for an end to "communal madness" that he said would weaken the unity of India.

Some of the victims, mainly Sikhs attacked by Hindus, were pulled out of trains by angry mobs and killed on railroad platforms. Twenty-seven passengers were killed on trains in Haryana State alone, according to the United News of India news agency, and other massacres aboard trains were reported in several northern Indian states.

The sharp criticism of Gandhi's handling of his first crisis as India's youngest prime minister was issued as Gandhi prepared to lead several million mourners to his mother's cremation today alongside the Yamuna River.

The four-hour procession through the city to Indira Gandhi's funeral pyre was expected to pose major security problems, complicated by the presence of heads of state and dignitaries from about 100 nations. It was announced officially today that the procession route was changed, apparently for security reasons.

Observers noted today that far fewer people appeared to be lining the streets than had been expected, apparently because of fears of violence and a lack of public transportation, which is mostly run by Sikhs.

Soviet Premier Nikolai Tikhonov, among the first to arrive, met tonight with Rajiv Gandhi, who said he would maintain India's policy of friendship with Moscow. "We would like to continue the same policies followed by Grandfather [Jawaharlal Nehru, the first prime minister ] and Mother," Gandhi said.

Pakistan, which has fought three wars with India since their partition in 1947, announced yesterday that President Mohammed Zia ul-Haq would lead its delegation. Other world leaders arriving for the funeral included U.S. Secretary of State George P. Shultz and British Prime Minister Margaret Thatcher.

The opposition's quickness to criticize Gandhi, while posing no immediate threat to his government, suggested that the issues of alleged lack of leadership and political inexperience -- focused on the assassination aftermath -- will be in the forefront of what promises to be a divisive campaign to unseat Gandhi in the next parliamentary elections.

The Janata Party, which ousted Indira Gandhi's Congress Party in the 1977 elections, joined with former prime minister Charan Singh and with leaders of the Bharatiya Janata Party (BJP) in blaming what they termed Rajiv Gandhi's ineptness and lack of leadership qualities for the continuing violence.

The opposition leaders also condemned the manner in which Gandhi was sworn in to succeed his mother without a vote of the full parliamentary caucus of the party, now called Congress (I), calling it a "serious violation of parliamentary norms and democratic traditions."

Later last night, however, Gandhi was unanimously elected leader of his party by its parliamentary caucus, providing the necessary technical stamp of approval to his induction as prime minister.

The opposition attacks appeared to signal a rebuff of the prime minister's appeal to all political parties yesterday for support of his efforts to curtail violence after the assassination. In a joint statement issued after a meeting with Gandhi, opposition leaders had urged all workers of all of India's political parties to "exert themselves to the utmost" in restoring communal harmony.

Singh, prime minister in 1979 and now head of the Revolutionary Workers-Farmers Party, led the attack based on charges of apathy and ineptitude in the new administration. New Delhi Bharatiya Janata Party president K.N. Shahani said that "paralysis" in the government had created "an all-around sense of insecurity in the capital."

While government spokesmen insisted that order had been restored in New Delhi and throughout most of India, the death toll in three days of violence continued to climb to an unofficial total of more than 750 persons, two-thirds of them killed in the capital. Thursday night a government spokesman claimed that only 12 persons had died in sectarian rioting, two of them in New Delhi, and yesterday the state-run radio and television referred to unofficial figures compiled by Indian news agencies as "wild rumors."

Gandhi assured his party officials last night that the situation was "under control."

However, at one police morgue in north Delhi, nearly 200 bodies, many of them charred beyond recognition, were stacked three high in rooms overflowing and in a courtyard, awaiting autopsies by an overburdened medical examiner's staff.

L.T. Ramani, chief of the Subzi Mandi police mortuary, when asked about the government's low death figures, replied, "Maybe they are not aware of details. There is no question of hiding [bodies]."

Hundreds of Sikh travelers from all over India were reported stranded at the New Delhi railroad station, the Associated Press reported, afraid to continue their travels without armed escort. Several Delhi-bound trains, including the Rajdhani Express out of Bombay, were canceled because of what a railway official called "disturbed conditions in the capital."

At the Charbagh railway station near Lucknow, police opened fire on a violent mob after two Sikh passengers were killed and a dozen injured while their train was stopped. More than 50 passengers were given shelter in the station as police continued to disperse the mob, according to Indian news agencies.

The killings recalled similar carnage during Hindu-Moslem violence following the partition of the Subcontinent in 1947.

At Willington Hospital here, officials said that 51 bodies had been brought in during the rioting, many of them with gunshot wounds and evidence of having been attacked with swords. The hospital said 622 wounded had been brought for treatment.

Violence continued yesterday in parts of New Delhi, with more than 50 persons killed in economically depressed resettlement colonies just across the Yamuna River and in the northern part of the city. Reuter quoted a deputy police commissioner in Trilokpuri, a slum area about 10 miles from central New Delhi, as saying that a mob beat and burned inhabitants for several hours early this morning, leaving at least 94 dead there.

With a heavy Army presence and a curfew in force in many areas, however, large sections of the capital remained peaceful throughout the day following arson and looting Thursday that left scores of Sikh homes and businesses destroyed.

Army troops were sent into an additional 13 cities in northern, western and central India yesterday, according to military authorities.

[Three towns in Haryana State, adjoining New Delhi, were among the hardest hit in yesterday's violence, Reuter reported. The towns -- Gurgaon, Sonapet and Faridabad -- are within 15 miles of the capital.]

Reports on the accumulating death toll since Wednesday put the total highest in the northeastern state of Bihar, with 79 killed there. Sixty-one deaths were reported in violence in the central state of Madhya Pradesh, 49 in Uttar Pradesh, to the north, 43 in Haryana, 16 in Jammu-Kashmir, in the far north, and eight each in West Bengal, in the northeast, and in the west central state of Maharashtra, according to the United News of India.

In his televised broadcast, Gandhi pledged that the government "will ensure the safety of life and property of every citizen, irrespective of his caste, creed or religion."

Gandhi, who has held five high-level meetings on restoring order since the assassination, added, "Indira Gandhi gave her life so that a united India should live and prosper. . . . Communal madness will destroy us. It will destroy everything that India stands for. As prime minister of India, I cannot and will not allow this."

Echoing a theme often sounded by his mother, the new prime minister warned that communal divisions in India are "only helping the subversive forces to achieve their ends."

Following his election as the successor to the Congress (I) leadership that his mother held -- a post technically necessary for assuming the premiership -- Gandhi assured party members that a thorough investigation was being made into the assassination.

Indian news agencies reported last night that the entire security staff at the prime minister's residence had been disbanded after the assassination and replaced with central government intelligence agents.