The gains came even as India’s IT sector continues to face headwinds, including subdued discretionary technology spending, pricing pressure, higher employee costs and uncertainty over how artificial intelligence could affect conventional outsourcing revenues.