Isochrone ages for ∼3 million stars with the second Gaia data release