Those changes were cheered by investors and foreign governments but have been contentious in India, where decades of paternalistic and protectionist economic policies still garner considerable support. India’s once fast-growing economy has slowed considerably this year, and the government is hoping the measures will help jump-start growth.

While it riveted the nation, the debate had more symbolic than practical importance. The government had announced that it would go forward with its decision to open foreign investment regardless of how Parliament voted. It won Wednesday’s vote, 253 to 218, partly because members of two of its allied parties, whose leaders said they opposed the policy, were among the more than 40 members of the lower chamber who walked out before the voting, largely to deny a victory to the opposition. Prospects for approval in the upper house of Parliament are less certain.

The debate grew comical when Sushma Swaraj, the leader of the opposition in the lower house, said that McDonalds was importing potatoes used for its French fries because Indian potatoes were deemed to be too small. McDonalds India responded that it bought its potatoes locally, and a member of Parliament who supported the government noted that farmers in a state ruled by Ms. Swaraj’s party supplied potatoes to McDonalds.

The government’s victory was a blow to the Bharatiya Janata Party, the main opposition party, which lost the vote even though a majority of members of the lower house had expressed resistance to the underlying policy. The party has been linked with anti-Muslim actions and sentiments, so regional parties that rely on Muslim votes have been reluctant to support its positions.

India’s electoral politics have become so intensely competitive that few parties are willing to offend Muslims by being linked with the Bharatiya Janata Party. The strength of the distaste for the Bharatiya Janata Party that was demonstrated Wednesday could spell problems for the party in the lead-up to the 2014 elections, when regional parties are expected to gain even more power.