I hope a real expert on India in the early 20th century responds.
I can offer some musing comparisons with other places.
The party line as put out by Lenin (and explained by Trotsky, later) of the Bolsheviks was that proletarian revolution was possible in Russia, despite the fact that per capita Russia was a lot less developed than the Western European nations most orthodox Marxists figured The Revolution would start in, because Russia was part of a global economic system that was collectively in crisis. So capitalism came into crisis on a global scale for global reasons; despite the relative weakness of industrial development, with urban and rural industrial workers (such as miners, which is where we got Nikita Khrushchev for instance, from the Donbass region of Ukraine) being still outnumbered by peasants, which boded ill for a working class that needed overwhelming mass numbers as well as some technical sophistication to overcome the organization of the Tsar's regime, on the other hand the Tsar's machinery was also weak and rickety and not the most modern. This would be OK for the non-proletarian ruling classes, if Russia were alone in the universe, experiencing capitalist development on her own. However, Russia was not alone. On one hand, the capitalist sector, especially the urban industrial sector and certain industries like oil drilling, were more developed than Russia alone would have come up with, due to foreign investment. This in turn meant the proletarian working class was considerably more developed than the general state of the empire's development would lead one to guess. At the same time, the pressures on the regime were not proportional to what one would expect from textbook capitalist development in a vacuum. The European leading capitalist powers had seized effective control over the whole world and were quarreling about how to divide it up; the advanced capitalist powers could build up military forces using technologies that made mass armies more effective, could draft and train vast armies equipped with such weapons, and recruit from populations composed of highly literate working classes familiar with industrial machinery. In these respects Russia clearly lagged, though not as much as one might think--but one of the charms of investing in Russian industrial development from a foreign investor's point of view was very cheap labor, as peasants straight from the villages could be trained to serve suitably designed industrial processes. So the immiseration of the working class, such a strong theme in the 1848 Communist Manifesto, later mitigated and sophisticated considerably in Marx's Capital, was a more literal reality in WWI era Russia--the industrial workers, despite having skill sets and knowledge quite close to their considerably better-off Western counterparts, did indeed literally have little to lose but their chains.
Lenin viewed regimes like Tsarist Russia as the weak links at which the global chain of capitalism could be broken; once fallen to a general working-class uprising in Russia, the ruling classes of the Western world, despite their greater resources and sophistication, would find their order unravelling on them, especially if the trigger of Russian revolution was a general world crisis in which the Western capitalist nations were under strain too.
But the Bolsheviks, despite having the hope of winning on their own in Russia, only considered the job half-done until the Revolution spread to the heartlands of industrial development. Not only would socialist Russia need the aid of the more developed nations, still more the Revolution in a peripheral semi-rural backward autocracy would be in grave danger of being crushed as an existential threat by the capitalist powers; revolution in the west would remove that threat.
----
Now how can these considerations apply to India?
First of all, though the British were clearly stretched thin in trying to rule nearly a billion people as aliens ruling from above and having little to no intention of assimilating these hundreds of millions to their society, clearly the Raj was on the whole a less vulnerable structure than the Tsar's regime. It drew on British resources, it drew on hundreds of years of negotiated arrangements with local powers. It held out, to Indians who could tolerate the contempt and second-class status the British offered them, positive prospects of individual success within the largest national framework of capitalist enterprise in the world. True, Britain was slipping from its status as the world leader both in sheer mass of industrialization and in innovativeness, falling behind such upstart powers as Germany and the USA. Still, remaining in the British system would have its temptations for certain kinds of aspiring Indian--how much appeal this option had depended on just how astute the British were in running the place.
Conversely, the Empire as traditionally run existed to enhance the prospects of business in Britain itself. When being run well, the sophisticated and mass-produced tools of modern warfare, and the wealth of the Empire in general, were made for the most part in Britain, by the most proletarianized industrial workforce on the globe. So India under British rule would not need as much industry positioned in India itself, for the British authorities to still have ready to hand sophisticated arms and other technologies for purposes of maintaining their power there.
Thus for India, the class struggle was more a matter of nationalism and less apparently a matter of class warfare. Indians who in the latter scenario would be on the reactionary side, as industrialists, big landowners and so on, were instead amenable to feeling they had little choice but to be nationalist revolutionaries.
Then too, although the large population of India means that even relatively small fractions of the population can add up to big efforts on an absolute scale, still, I suspect that per capita despite centuries of British involvement India was much less developed than even Russia of 1914. The population was not I suspect broadly and deeply enough industrialized to make even the worker/peasant alliance that characterized the Bolsheviks of OTL.
So, while the Bolsheviks did indeed make much of the importance of anti-colonial struggles (being as they would be, more hacking apart the chain of world capitalism) their own revolution was hardly a model of how to conduct these.
Nor would the rise of Mao's wing of the Communist Party of China be a good analog; the Chinese Communists discarded much of the Kremlin's advice (and orders) as irrelevant, but their development was in yet another situation, one where the old regime was weak to the point of near-nonexistence while third parties attempted to subjugate them. The Maoists won legitimacy by offering competent and resolute order in this chaos.
Either way, either the Russian or Chinese model of Marxist revolution in India seems to presume that the Raj has already been driven from the scene. A successful nationalist revolution, tossing out the British, might have been followed by development on a roughly Russian model, if the nationalists fell under the strong leadership of something analogous to the Romanovs in Russia, playing off discontents in the poor masses against each other, developing in a top-down manner based on securing foreign alliances and investments but not falling again to straight foreign rule. Or the Raj might be destroyed either by domestic uprising or the invasion of some third foreign party, leaving Indian Communists to piece together a Maoist-like resistance that eventually triumphs. But only after the British are long gone.
I don't want to preclude a third model but I don't know what it might look like.
A steampunk Victorian Britain might conceivably have developed India more, on quasi-Romanov like lines, perhaps. But if they had even the limited success the Russian monarchy had, proletarianizing perhaps 30-40 percent of the population, the resulting India would have been an industrial colossus, eclipsing the full potential of British industry. The Raj would have a (Bengal!) tiger by the tail trying to stay on top of that giant. More to the point, it could hardly be done easily.
OTL the Indian nationalists did of course include radical Marxists in their ragtag and fractious coalition. Post-independence, there has been both capitalist development and a certain amount of socialism in India. These factors mean that hard-line revolutionary Marxism, along with social-democratic reformist Marxism, has been a part of the Indian political scene all along. One can imagine timelines that start with India as OTL in 1947 and go from there to a Marxist India, perhaps.
But I don't see a clear path for the movement that first throws out the British to be Communist dominated from the get-go.