Decay dynamics of the long-range H¯Σg+1 state of D2 and H2: Experiment and theory