A prominent opponent of Indian Prime Minister Indira Gandhi is challenging her announced intention to hold open elections in March by asking for a guarantee that he will not he arrested if he returns from the United States to run for Parliament.

Ram Jethmalani, former head of the bar Council of India, and the only opponent of Ghandhi to receive formal political asylum in the United States, said yesterday that he wants to return to India to run for Parliament in a Bombay district that probably would pit him against law Minister H. R. Gorhale.

"If she doesn't meet what I have asked for, it will be proof that everything is just a sham," the 53-year-ols Bombay lawyer said yesterday.

Jethmalani said he does not believe that Ghandhi seriuosly intends to restore democracy in India. He pointed out that just after she announced the elections, Ghandhi passed over the senior judge on the Supreme Court, who had ruled against her, and appointed as chief justice he judge who had defended the national emergency declared in June 1975.

Jethmalani is the second to announce his intention to return since the election was declared. Subramaniam Swamy, former member of the Indian upper house who also has a warrant out for his arrest, left his teaching position at Harvard last week to return to India.

In announcing the election on Jan. 19, Gandhi said that the rules of the national emergency, under which thousands had been jailed since June 1975, "are being further relaxed to permit all legitimate activity necessary for recognized parties to put forth their points of view before the people."

Two days later the government announced that political detainess were being released and that no further arrests were to be made unless specific authorized by the central government. The laws under which thousands of political opponents were arrested remain on the books, however, as does the emergency declaration itself.

Jethmalani, who has been teaching law at Wayne State University, wrote to Indian Ambassador Kewal Singh last week saying that he wants to "actively participate" in the March election and that he wants formal assurance that "on my return no law of preventive detention without trial will be used against me."

He said he did not claim immunity from prosecution in a regular court of law for any other offense, according to a copy of the letter.

The Bombay attorney said that speedy action by the Indian government was necessary because he has to file election papers by Feb. 10. He has been selected as a candidate if the newly formed Janata (People's) Party, an amalgam of four parties that oppose Gandhi's ruling Congress Party.

A warrant for Jethmalani's arrest was put out after a speech he made in January in his capacity as head of the Indian equivalent of the American Bar Association. He had been one of the most outspoken opponents of the Gandhi government, both before and after the declaration of national emergency, because of what he viewed as her assault on Indian legal principles.

He left India in April after the Indian Supreme Court struck down appeals of emergency decrees and came to the United States.

The Indian government announced yesterday that virtually all political detainees had been released, but the Janata Party named 10 prominent opposition figures still being detained, including Socialist leader Raj. Narain elections. The party claimed that at least 6,000 other partty workers remained in jail, Reuter reported.