Quantum dynamics of impurities in a one-dimensional Bose gas