As mentioned above, the difference is the magnitude of voltages in play. Where walking across a carpet can generate a voltage of 1000V, and the human body is known to accumulate charges of up to 25,000V to give you an idea of what range of voltage might be transferred to the comb. However, the voltage of a typical battery you are likely to come into contact with is maybe 5V, 12V, 18V or 24V for consumer electronics or cordless tools for instance. For further contextualization, the voltage of a battery in a Tesla vehicle is around 350V give or take.
Here is actually a research paper on measuring the charge in hair, referencing a study that measured the electric field strength ranging between 20kV/m to 120kV/m:
https://cg.cs.uni-bonn.de/project-pages/hairmodeling/documents/HairElectricity.pdf
And here is a source discussing the noticeable effects on electric field strength on noticing changes or impacts on one's hair with ranges of field strength within the range of what was stated in the referenced study: https://books.google.ca/books?id=fhWlDwAAQBAJ&pg=PT212&lpg=PT212&dq=kv/m+hair+charge+voltage&source=bl&ots=7ZoVoa31nZ&sig=ACfU3U1rSCrz8vsI2eCokdgyX2v71yZjNg&hl=en&sa=X&ved=2ahUKEwiY9p2Jl_bpAhWSknIEHdHcA8EQ6AEwAXoECAwQAQ#v=onepage&q=kv%2Fm%20hair%20charge%20voltage&f=false
So in general, the energy that can be discharged between objects is much smaller for a battery than that of a generated electrostatic charge. To give you some more insight, this particular phenomenon you are describing is known as the triboelectric effect, where 2 materials that come into contact with each other exchange electrons (one gives, one takes).