In an expanding universe, energy isn't conserved. (Unless we do the trick we always do with energy and just define it to be conserved https://youtu.be/lCgKTpIzjRk?t=174 )
I don't know exactly why you think this applies to charge conservation. The U(1) symmetry is where charge conservation comes from and it isn't affected by an expanding universe.
There is "rest mass" and "relativistic mass". The GP is talking about "rest mass" that is not conserved even in simple examples.
Most modern books try to eliminate "relativistic mass" because it's misleading, for example is good to calculate acceleration perpendicular to the movements (for example in a cyclotron) but it's not good to calculate acceleration in the direction of the movement.
So most modern books they call the same idea just "energy" and use that "energy" to calculate gravitation. "Energy" is conserved in special relativity and almost conserved in general relativity.
But the "relativistic mass" is useful in some problems and is widespread in popular culture and don't ask about the weird parts of the mass of the proton, so it's difficult to kill the idea.