Ganguly in tests and Dhoni in limited overs.
I judge captains primarily by how they improve on what they start with, and the results they achieve relative to the resources they have.
Ganguly in test cricket was not exceptionally brilliant tactically, but he gave the team a backbone and aggression that helped them win dramatically improve their record overseas. On top of that, he built the core of a test team that served India for a decade.
Dhoni's test captaincy can be split into two periods, from 2009 to 2011 when he was unbeaten at home, won in NZ and WI and drew in SA. At that point, he was a contender for the subcontinent's greatest captain ever. But in hindsight it is clear he was building on the hard work done by Ganguly, Dravid and Kumble previously. But from 2011 to 2014 his defensive instincts became clear and he made it a tendency to lose faith early on in his bowlers, fail to take initiative and let winning moments slip regularly. This article sums this up well:
https://www.espncricinfo.com/story/_/id/21555781/defensive-dhoni-hurts-india-again
In ODIs and T20s though, Dhoni to me is the greatest captain of them all, winning all the major trophies, beating Australia in a tri-series away, all with a team with limited bowling resources. He always seemed ahead of the game and was one of those captains I felt who basically 'figured out' the format.
Dhoni is a strange one, his 'keep it cool' instincts work so well for him in ODIs and totally against him in tests.