Indian Prime Minister Narendra Modi has gained a political reprieve with a parliamentary victory that could reshape electoral representation in the world’s largest democracy, even as his government grapples with mounting youth discontent over jobs and the rising cost of living.