NEW DELHI — On Saturday, Rahul Gandhi, the heir of the Nehru-Gandhi dynasty, is to formally take over as the president of the Indian National Congress. His family has run the Congress party for four generations. His father, Rajiv Gandhi; his grandmother Indira Gandhi; and his great-grandfather Jawaharlal Nehru governed India as prime ministers for a combined total of 38 years.

Mr. Gandhi, 47, is succeeding his mother, Sonia Gandhi, who has been at the helm of the party for the past 19 years. The Nehru-Gandhi dynasty outrivals the Kennedys’ for longevity. Mr. Gandhi is taking over at a time of decline in the fortunes of the Congress party, which suffered a devastating defeat by the Hindu nationalist Bharatiya Janata Party in 2014 and controls a mere five out of 29 state governments.

With his party’s repeated failures to win elections in the face of the combination of charisma and aggressive Hindu nationalism that fuels Prime Minister Narendra Modi’s politics, Mr. Gandhi has settled on a carefully devised departure from the party’s past by openly and visibly embracing his Hindu identity.

The Congress party has had departures from its commitment to secularism and minority rights in the past — acts of violence against Muslims under its watch and culpability in the 1984 massacres of the Sikh minority — but never before has it abandoned its rhetorical and symbolic commitment to these ideas.