Prime Minister Narendra Modi’s party was set for a historic victory as India counted hundreds of millions of votes from its general election on Thursday.