I've had similar fun with UK postcodes. Lots of people claim to know the answer but, because it's not a calculation, it all hinges on having reliable data. It looks like the Indian government publishes pincodes with latitude and longitude here:
https://data.gov.in/catalog/all-india-pincode-directory but the data appears to be incomplete so far. I'm not sure who else has the data if they don't!