They would have left eventually, and probably sooner rather than later.
The British had probably passed "the point of no return" with the Government of India Act in 1935. This greatly strengthened the provincial structure (where Indians could be reperesented), resolved some provincial issues (like splitting of Burma from India) and created a Federal structure of British and Indian held territories. The act transfered control over most internal matters, the "interior," health, education, and social services to the Indians, while leaving defense, foreign affairs, police, press, and electric power matters in the hnads of the British. This followed the establishment of a "diarchic" government that transferred minimal powers to Indian authorities in 1919, because Britain was grateful for "Indian" help in World war I. Basically, the structure for eventual Indian independence had been laid by 1935.
Another important factor was the rise of Japan and China. Unfortunnately, the "real life" result was their participation in World War II, which brought about India's independence. But a peaceful result could have been their rise, and their joint stand against European colonialism in Asia. Japan had a model Parliamentary system (if not a full democracy), and China (before the rise of the Communists) was also moving in a democratic direction. Finally, the Americans had granted future independence to the Phililppines in 1934, with a scheduled independence date of 1946.With at least three strong examples in Asia, the British probably would have left India in the early 1950s. Even without this factor, the trajectory of the 1919 and the 1935 Acts suggested an early 1950s timetable for independence.