India's rejection of Prime Minister Indira Gandhi and her Congress Party confirmed an astonishingly widespread commitment to democracy above all else in that land.

Gandhi tampered with this commitment, established 30 years ago when India won its independence from Britian, by seizing dictatorial power in June 1975.

The nation's economy flourished during the 21-month state of emergency and Gandhi's political acumen could not be faulted for choosing what seemed to be an opportune moment for election:

With more grain on their tables than at any time in memory, the least-privileged majority of India's 600 million people could be counted on to vote for their benefactor.

With an apparent sense of discipline and national pride instilled in them, the aspiring middle class, particularly in the huge teeming sides, could also be counted on.

The handful of wealthy businessmen and industrialists, who as a group have always supported the Congress Party, were certain to express their gratitude for the ban on labor strikes and the resulting rise in production and profits.

Thus, when she announced two months ago that elections would be held this week, admirers and critics alike cocked their heads and smiled at the prime minister's running political savvy. Now, they reasoned, she would reap the harvest of the emergency period.

But onlookers, and evidently Gandhi herself, failed to reckon with the surprising sophistication of India's masses and their desire to recaptur their hard-won democratic legacy.

It has long been popular in India to dismiss as insignificant the concern of the poor - fully 80 per cent of the nation's 600 million people - for democracy. They had, after all, in bad times and in goods, returned the same family and the same party to power since 1947.

Although some Western critics used this record to denigrate the quality of the democratic process in India, the system worked better there than anywhere else in the developing world. The courts, the legislature, the press were as free and open as those in the United States and Britain, which were the models for India's government.

That was a source of pride to many Indians, sustaining them when foreign critics pointed to their failures and the gains of neighboring China under communism. Never mind, was the usual reply, we are still world's largest democracy.

This boast, which acquired a chill, hollow ring during the period of Gandhi's authoritarian rule, is once again valid. For no matter whether the new government proves less effective than the old and whether the nation's economy and social order move ahead or tumble back into disarray, the people of India have left no doubt about what values they consider most important.

These are, in essence, the values preached by the founder of modern India, Mohandas K. Gandhi, the frail, bespectacled Mahatma, who, through his preaching and his nonviolent actions, forced the British to leave the country and gave India the basis for political morality.

But the Mahatma's ideals, his plans for eliminating caste prejudices and other social evils, his sketchy economic program that stressed agricultural rather than industrial development, all were honored more in the breach than in practice.

Jawaharlal Nehru, the father of the present leader and a devoted follower of Mahatma Gandhi, quickly turned his attention to giant industrial projects when he became the nation's first prime minister. These were the days, the early 1950s, when bigger was considered better by development experts, particularly those in the industrialized West.

As a result, India has seldom been able to feed itself. The last two years have been an exceptional period during which a succession of excellent monsoons have helped produce record crops throughout the country. But a failure at any time in the rains to come could put the country back on the international bread line in quick order.

By the time Nehru's daughter became premier, in 1965, Ghandhism had become a relic that was taken off the shelf once a year to honor its assassinated founder. Yet, even at that time, no observer, probably not even Mrs. Gandhi herself, would have imagined that within a decade the Mahatma's doctrine would be dismissed out of hand, and by a woman who had been a child at his feet.

But after she took office as a shy, 48-year-old widow with two school age sons, Mrs. Gandhi quickly developed into a tough political infighter. Her ability to percive and react to threats to her power enhanced this image.

Her weakness, though, was her seeming inability to capitalize on her victories by producing concrete results that would benefit the country.The most graphic example of such a failure followed India's crushing military defeat of Pakistan in 1971 and the creation of friendly regime in the new nation of Bangladesh.

The victory over Pakistan, India's traditional enemy for more than a quarter of a century made Mrs. Gandhi one of the most powerful women in the world and, as Indian newspapers called her, "the empress of India."

That was the time, her critics would late recall, when she could have done anything and virtually the whole population of India would have been with her. Yet, she did not institute programs to control the dangerously spiraling birthrate; she did not take steps to eliminate the strengthsapping parallel economy of illegal and undeclared income; she did not turn her attention to improving food production and building stocks.

All of this, and more, she did only after imposing the state of emergency. And then it was all done with a heavy hand, sometimes brutally, in an atmosphere of dictatorship.

Undoubtedly the most onerous program Mrs. Gandhi instituted under the emergency was compulsory sterilization. Carried out by her younger son, Sanjay, the program alienated millions of Indians, not just those who were directly affected but those who saw it as the height of arrogant, brutality.

Mainly because of his clumsy handling of the sterilization program, Sanjay Gandhi became an albatross whose weight around his mother's neck would soon drag her down. His overwhelming defeat in a carefully selected constituency seems to be all the proof that is necessary that the story of his soaring popularity thoughout the country was government fabrication.

The prime minister's own humilitating defeat in a constituency she swept by over 100,000 votes in 1972, is almost beyond comprehension. By the accounts of her own supporters, she carefully cultivated the people of her home constituency for years. She saw to it that industrial projects were built in the area to provide jobs. She made sure than canals were dug to irrigate farms, that schools, hospitals and roads were plentiful.

Yet, the people who so obviously benefited from this largesse turned against her when they went to the polls. This seems to make clear that they were voting not so much for Raj Narain, Gandhi's opponent, as against her - another instance of a commitment to democracy taking precedence over practical advantages.

Having voted for an ideal the people of India will soon face the realities of helm for the first time in three decades. Not that the men and women who formed a hasily unified opposition are new to the political scene.