Would not an infinite electron field in a finite (observable) universe result in an infinite energy density and therefore the entire universe would collapse into a black hole?
Integrals over a finite interval can have (and often do have) a finite size even though the interval contains an infinite number of points, with an infinite number of different values at those point.
Right, because the integral of a function is not a straight sum of values of that function evaluated for every number in the interval; the integral of y=x dx for 0<=x<=1 is not 0+0.1+0.11+0.111+0.1111+...+1. Electrons have a fixed energy, so cramming an infinite number of them into a finite space necessarily requires infinite energy.
Well, I was referring to the electron field, not to electrons. According to QFT, particles are excitations of an underlying quantum field. It’s the field that is fundamental, not the particle. See e.g. [0]. And those fields are continuous, not discrete, i.e. can only be described by an infinite number of points and values.
The electrons are not wholly within the battery; they are mostly within the battery. (Batteries discharge over time for an almost completely unrelated reason.)