They have taken a derivative to analyze the minima of the total time taken. dT/dx = 0. But in reality should it not be 1/v which is a non zero value. What am I missing ?

Kinda confused by what you mean, they set the derivative to zero to analyze the graph. The derivative itself is not zero. 1/v would also not be the correct derivative.

Yes, it is the speed (or better, rate) of change of the total time when x changes. At the minimum that rate is zero.
Note that not everything with dimensions distance/time is the speed of some object (or wave). Here you have such an example.

Sorry, for the confusion. Over there they have dT/dx as 0, that is right, if you follow the graph and want to find out the minima. But then dx/dt = v. Which is less then or equal to the speed of light, clearly not infinity. So how can there be any point in the graph where speed is infinity, that is when dT/dx=0 (dT/dx = 1/v).

If you look at Snells law completely you can clearly see that the speed of light is either c, or 0 at the bounds when we set n between 1 and infinity.

Your v is the phase velocity, and it can be infinite, however this doesn't break known physics as the light still can only transmit information at c. This superlum v begins to happen with n's lower than 1.