Probing neutrino production in high-energy astrophysical neutrino sources with the Glashow resonance