Indeed, Ms. Jayaram and Mr. Modi — solitary autocrats from different corners of the country — have formed a tentative friendship, attending each other’s swearing-in ceremonies and exchanging birthday greetings. Cho Ramaswamy, a playwright and magazine publisher who has advised Ms. Jayaram in the past, said the pair was drawn together by a shared sense of grievance toward the ruling class.

“Both understand the difficulties of each other,” Mr. Ramaswamy said. “Both are against Congress.”

But neither has a history of forming lasting alliances. In his 12-year rule of Gujarat, Mr. Modi has split bitterly with former aides and mentors.

Image Mamata Banerjee Credit... Anindito Mukherjee/Reuters

Now, though, there is little doubt that he needs powerful partners who are, like him, outsiders to New Delhi’s traditional power structures, said Milan Vaishnav, an analyst at the Carnegie Endowment for International Peace, a Washington-based research center.

“This is where we don’t really know, because he’s never had to have any friends, he’s never had to build a coalition,” Mr. Vaishnav said. “In Gujarat, he’s been able to dominate and saturate the political space so entirely that he’s been able to lead from the top. You can’t do that so well at the center.”

Ms. Jayaram’s clout derives from her worshipful following in Tamil Nadu, something that was on full display at her rally.

Her face stared down from posters the height of five-story buildings, from shimmering porticoes made of bamboo fronds, from giant balloons that bobbed in the sky. Some 1,000 banana trees, heavy with fruit, had been cut and lined up to create an alley for her motorcade, interspersed with columns fashioned out of pineapples, watermelons and sweet limes.