AYODHYA, INDIA, OCT.31 -- Thousands of Hindu fundamentalists failed in a new attempt today to storm an ancient shrine claimed by Moslems, and at least 24 more people died in violence sparked by the dispute.

A government deputy minister resigned to protest Prime Minister V.P. Singh's attempts to block construction of a Hindu temple on the disputed site, deepening the crisis in his beleaguered coalition.

Armed paramilitary troops blocked about 5,/000 Hindus from reentering the mosque in Ayodhya, which has been the center of a decades-old dispute between India's Hindu majority and Moslem minority. Hindu fundamentalists broke through police cordons on Tuesday and chipped away bricks and plaster from the one-story mosque, which they want to replace with a temple.

At least five Hindus were killed and 20 injured when police opened fire to throw back the rioters Tuesday. Two of the injured died today, doctors said, and the Press Trust of India news agency said at least 22 other people were killed in street battles between Hindus and Moslems in four other cities.

The dispute has killed at least 170 people in eight days and pushed Singh's 11-month-old government to the verge of collapse. The Hindu fundamentalist Bharatiya Janata Party withdrew support from the governing coalition last month to protest government policy on the temple project.

The desertion left Singh without a majority in Parliament, but he has said he will win a vote of confidence scheduled for Nov. 7.

Singh's attempts to ride the religious and political crisis received another setback today, when the deputy minister for sports, Bhakta Charan Das, resigned to protest the police action at Ayodhya. Das, a Hindu, accused Singh in his resignation letter of "lack of foresightedness" in tackling the crisis.

The dispute also triggered violence in neighboring Bangladesh, an Islamic nation, where Moslem mobs attacked temples and Hindu shops and homes after hearing of the situation in Ayodhya. Authorities clamped curfews on the capital Dhaka and the port city of Chittagong to curb rioting.

The Ayodhya dispute has festered for decades, with Hindus claiming the 460-year-old mosque was built over the birthplace of Lord Rama, one of the most-worshipped Hindu gods. Moslems say it is impossible to pinpoint the birthplace of Rama and that they will not accept the destruction of the mosque.