Japan has stagnated,
Today. Apparently you've forgotten the entire period from 1946 to 1999. Like I said, short attention span.
China's overwhelming advantage over India and much of the rest of the world is its 5000 years of centralization, plans that would have been non-starters in a decentralized government and economy, like One Child and the open development of the Great Firewall, are acceptable there. Brasil is a special case, drastically underpopulated and resource-rich, while India is the exact opposite. You're not even comparing apples and oranges, more like apples and Barkaloungers.
Where would India be today without Indira Gandhi's education program? One only needs to look at its neighbors Pakistan and Bangladesh to see, and that was the intent of the British when they left behind a deliberately non-functional government. Where will India be in half a century if it continues to slowly and thoughtfully expand its space program? Neither you nor I can even guess, except to say far ahead of where it would be without that completely home-grown, internally-sourced, high technology industry.
Stand back and take the long view, look forward a generation or two. Other cultures do it, which is why Japan, China and India have repeatedly risen from the ashes like the phoenix.