It was the first time since Narendra Modi took power in 2014 that one of his Cabinet ministers had resigned under public pressure, a sign of the threat posed to the prime minister.