Measurement of the distributions of internuclear separations in 3.0 MeV H2+ and 3.63 MeV HeH+ beams