Yes, we do measure a declining abundance of elements heavier than Hydrogen or Helium as we look further away and further back into the history of the Universe, but the scatter is very large.
The production of heavier elements depends strongly on how efficiently galaxies produce stars, and this again depends on the mass of the galaxy, among many other things. This means that there is a tendency that if you look at heavier galaxies, they will tend to get enriched with heavier elements (often measured by the Oxygen to Hydrogen ratio, O/H, or the somewhat odd but very commonly used number 12 + log(O/H)) much sooner than lower mass galaxies.
Because the heavy elements are primarily produced in stars, they are also found in much higher abundance where the stars are, in the Interstellar Medium(ISM) of a galaxy than in the gas surrounding them (the Circumgalactic Medium or CGM) and even less in the gas between the galaxies, the Intergalactic Medium (IGM).
So you will find galaxies in the very early Universe which have much higher Oxygen abundances than CGM or IGM at much later times, and you will find higher-mass galaxies with higher abundance at early times than lower-mass galaxies at later times.
But all in all, there definitely is a rising tendency in the ratio of O/H, as a proxy of the general abundance of heavy elements, as we get closer to our time and our galactic neighbourhood. This is also in good agreement with everything we know; once Hydrogen nuclei have fused to heavier elements inside stars, there is no easy way to un-fuse them back to Hydrogen again, so they will of course accumulate over the course of Cosmic history.
PS: Some more Googling led me to the below figure, taken from this paper, which shows the time evolution in "metallicity". In astronomy, all elements heavier than Helium are called "metals", including e.g. Carbon, Oxygen, and even most noble gases, and the metallicity is the abundance of these elements compared to that of Hydrogen.

The measurements in the figure are all done in so-called Damped Lyman Alpha systems - in short, these are galaxies, the gas of which happens to lie in front a quasar. The nice thing about these is that the metallicity of a galaxy depends quite strongly on how far from the galactic centre we measure the gas. Using quasars to select them means that we get a good statistical randomness in the mass and radius of the galaxies, although with a geometrical bias towards the outer parts. Note that the M/H (metallicity) is shown on a logarithmic scale, so the evolution, but also the scatter, is stronger in reality than it looks.