Statistical mechanics of vortices from D-branes and T-duality