Single terminal of voltage source attached to earth ground
If I understand your question correctly, a battery isn't required to demonstrate this problem. Say you have any object, at some potential. Then, you connect it to some other potential. Does some current flow? Let's say it's a cube of metal, and it's at Earth's potential, plus one volt. Then, it's suddenly connected to Earth:
simulate this circuit – Schematic created using CircuitLab
Short answer: no current flows. There is no circuit for current to flow.
But this is an approximation, made to simplify analysis. We are neglecting an important fact: everything has some capacitance to everything else. The metal cube is one plate of the capacitor, and Earth is the other. So the circuit is actually this:
simulate this circuit
In this case, when V1 suddenly becomes 0V, some current will flow. The total charge that will flow will depend on the capacitance \$C\$, which is very tiny. Maybe \$1fF\$, if even that. We know that capacitance times voltage is charge:
$$ CV = Q $$
So the total charge that will flow if V1 goes from \$1V\$ to \$0V\$, and \$C\$ is \$1fF\$ is:
$$ 1fF \cdot -1V = -1fC $$
This is a very tiny charge, well beyond insignificant to any practical circuit.
The current that will flow is a function of how fast \$V_1\$ changes, and the capacitance \$C\$, according to:
$$ I = C\frac{\mathrm{d}v}{\mathrm{d}t} $$
So how does this relate to ESD?
ESD is what you get when the potential difference between two things is great enough to breakdown the insulation between those things. Usually that insulation is air. How much voltage this takes depends on many factors, and I'm hardly an expert, but we are talking about differences measured in kilovolts.
These high voltages are attainable precisely due to the very small capacitance between you and everything else. Recall again that \$CV=Q\$. We can rearrange that as:
$$ V = \frac{Q}{C} $$
If \$C\$ is very small, then a very small charge \$Q\$ can lead to a very high voltage. When you shuffle across the rug you might only transfer a (metaphoric) handful of electrons, but that's enough to change your voltage relative to your environment quite a lot.
Once you are talking about kilovolts, and not the \$1V\$ in the example as before, that insignificant current is not so insignificant any more. Still small, mind you, but it's applied in such a brief instant it can damage sensitive devices.
Perhaps the most commonly damaged device in modern times is the gate insulation oxide in MOSFETs, which is so thin it might have a breakdown voltage of maybe \$10V\$. If you had enough charge on you to raise your voltage enough to zap the relatively strong air around you, then the few atoms of silicon dioxide can hold that charge back about as well as wet tissue paper: