Using double quantum dots as the weak link of a Josephson junction, we realize the superconducting analog of the celebrated two-impurity Kondo model. The device shows a cusped current-voltage characteristic, which can be modelled by an overdamped circuit relating the observed cusp current to the Josephson critical current. The gate dependence of the cusp current and of the subgap spectra are used as complementary ground-state indicators to demonstrate gate-tuned changes of the ground state from an inter-dot singlet to independently screened Yu-Shiba-Rusinov (YSR) singlets. In contrast to the two-impurity Kondo effect in normal-state systems, the crossover between these two singlets is heralded by quantum phase boundaries to nearby doublet YSR phases in which only a single spin is screened.