Prime Minister Indira Gandhi's beleaguered Congress (I) Party, recovering from a series of state election setbacks that had portended possible trouble for her national leadership, tonight decisively turned back opposition challenges in key balloting for local offices in the federal district of New Delhi.

In municipal elections that were closely watched for signs of the same kind of erosion of support in northern India that had spread in southern states, Congress (I) candidates for the 56-seat Metropolitan Council took a two-to-one lead over the main opposition Bharatiya Janata alliance and attained a comfortable majority of 48 seats.

Incomplete returns showed that Gandhi-supported candidates also were winning nearly two-to-one over the opposition in races for the less important 100-member Municipal Corporation, which oversees public services. Congress (I) leaders claimed a vindication of Gandhi's policies and said the local election proved that Congress (I) defeats last month in the southern states of Andhra Pradesh and Karnataka were an anomaly attributable to growing linguistic and cultural regionalism in some states.

Gandhi had mounted a costly and well organized campaign in New Delhi, spearheading the effort with numerous personal appearances.

An election loss in the capital, besides representing a major blow to the prime minister's prestige, would have signaled a possible voter revolt against Congress (I)--the I is for Indira--in the crucial Hindi-speaking belt of northern India, which traditionally spells the difference in national elections.

Although the election was local, it assumed the character of a general election in microcosm, with top leaders of all the major national parties campaigning and putting their prestige on the line.

Among them were the prime minister and her 39-year-old son and heir apparent, Rajiv, whom Gandhi had appointed a general secretary of the Congress (I) Party as part of an eye-catching shake-up of the party and the government seemingly designed to establish the appearance of major reform.

Although Congress (I) shares control of 15 of India's 22 states and enjoys a two-thirds majority in Parliament, it has not been able to win a majority in the past eight state elections, all of which have taken place since Gandhi returned to power in 1980.

The Congress defeats on Jan. 5 in Andhra Pradesh and Karnataka, both Congress strongholds since India won independence in 1947, were particularly embarrassing to Gandhi because both she and her son had campaigned hard in the southern Indian states in an effort to keep the party organization in that region of the country from unraveling.

The losses were interpreted as a repudiation of Gandhi's attempts to impose central authority on distant states, as well as reflecting voter rebellion against what has been perceived as insensitive, incompetent and corrupt leadership by assemblymen and ministers who attained their positions by virtue of loyalty to the prime minister.

The New Delhi elections had been widely recognized as a test of whether Gandhi could regroup her forces enough to ensure that her party will retain national power in the next general elections, which must be held by January 1985.

In numerous campaign appearances in New Delhi, Gandhi mostly ignored local issues and candidates and concentrated on national issues. The main thrust of her appeal was national unity and a call to resist the forces of regionalism that are running so strong in some of India's culturally and linguistically diverse states.

The Janata party raised several issues, including corruption, rising prices and the denial of democratic rights to the people of the capital. When she returned to power in 1980, Gandhi superseded the two local ruling bodies, imposing central government rule, and there had been no local elections since.