Everything was good even my grandpa house have electricity stabilizer, already check all basic thing.
Almost forget" the reason why I mention "underground soil" because my dad telling me that lightning often strikes trees near the house when raining follow by lightning.
I'm not aware of the mineral content of the ground below your house will affect the battery quality. The more likely scenario if lightning often strikes in the area is that many of the electronics/electricity infrastructure will break if not properly protected. There are many higher possibility scenarios other than your theory about the "underground soil" that is easily overlooked:
* The more remote the location, the quality of electricity usually goes down.
* It can be at some point, your electricity went down so it drains your UPS battery without you knowing.
* etc
One theory about mineral composition is about proper/improper grounding for electricity. Maybe you should check it out.