Prime Minister Narendra Modi declared victory for his alliance in India’s general election, claiming a mandate to move forward with his agenda, even though his party lost seats to a stronger than expected opposition, which pushed back against his mixed economic record and polarizing politics.