Josephson coupling mediated by quantum diffusion