Jagdish Bhagwati, a Columbia University economist who claims to be the intellectual father of India’s economic liberalization, argued in 2013 that the poor celebrate inequality, and with the poise of a Marie Antoinette, advised malnourished families in India to consume “more milk and fruits.” Arvind Panagariya, a colleague of Mr. Bhagwati’s who now works for the Indian government’s economic policy think-tank, took to arguing that Indian children were genetically underweight, and not really as malnourished as the World Health Organization had claimed. The 2015 Nobel laureate Angus Deaton rightly calls such positions “poverty denialism.”

The sheer potential of India’s market — 1.2 billion consumers, many of them young — bred intoxicating illusions among businesspeople, investment consultants and financial journalists. Never mind that it was the extraction of natural resources, cheap labor and foreign capital inflows, rather than high productivity or innovation, that was fueling India’s economy. Or that economic growth, of the uneven and jobless kind, was creating what the economists Jean Drèze and Amartya Sen have called “islands of California in a sea of sub-Saharan Africa.”

Many foreign journalists reporting on globalizing India had a knack for parachuting only into islands like tech-y Bangalore, from where the world perhaps does look flat. Their delusion was deepened by India’s own, chauvinistic, media: The country’s leading business daily, The Economic Times, even had a regular feature called “Global Indian Takeover.” Described with enough Ayn Randian clichés about ambition and striving, every slumdog looks like a budding millionaire.

Indifferent to poverty and inequality, and immune to evidence or irony, India’s largely corporate-owned press and television reveled in the fame and wealth of corporate magnates and of cricket and Bollywood stars. All the while they stoked hatred against such enemies of rising India as Kashmiri separatists and their Pakistani supporters.

But in 2010 corruption scandals began to expose India’s government — headed then by technocrats trained at Oxford, Harvard Business School and the World Bank — as both venal and inept. Mr. Modi and his hawkish Twitter account emerged into national politics just as growth faltered and many frustrated aspirers and also-rans started to think of the promise of widespread enrichment as an elaborate hoax. He noticed that they were venting against flailing political representatives and their apparent cronies among newsgatherers. He accordingly packaged himself as an efficient executive, exploiting Indians’ great esteem for technocratic managerialism. (“Mein Kampf” is a perennial bestseller in India, Hitler being seen as an exemplary nationalist-cum-people-manager.)

More important, Mr. Modi grasped then, as astutely as Mr. Trump does now, the terrible political potency of ressentiment. Positioning himself in the gap between the self-righteous beneficiaries of globalization and irascible masses, he claimed to be the son of a modest tea-vendor who had dared to challenge the corrupt old dynasties of quasi-foreign liberals.

For all his humblebragging, Mr. Modi, like Mr. Trump, illustrated perfectly how money talks, power seduces and success eclipses morality. One of Mr. Modi’s most loyal fan bases was rich Indian-American businesspeople, who were naturally attracted to the promise of a wealthy India allied with the United States. And conversely. At a charity event in New Jersey last month, Mr. Trump sought their support, and hailing India’s prime minister as a “great man,” declared, “I am a big fan of Hindu.” “Big, big fan.”