Sometimes trainers will do this in my area too! I think it's to maximize the resources and time you have to spend to prestige the gym back up. It might be a "mind games" type thing where they eventually hope to exhaust your efforts and then take over. Only reason I say that is because most of the competitive aspect in-game is fighting over territory (gyms) and it's a relatively meta thing to do.
I have a similar mentality where I'll check on the gyms i'm defending periodically. If someone dropped it from let's say 52,000 to 37,000 prestige then left, I'll go train it back to 50,000. The more I do that, the less other people seem to go after the gym(s).