Optimal estimates of trace distance between bosonic Gaussian states and applications to learning