Personally I am a fan of a regular, low cost maintenance,regime and not a fan of 'upgrading for upgrade sake - its a great way to overspend because you inevitably throw away perfectly good parts. A 2009 bike with 12Speed drive train might be better than original, but it is not a 2019 bike. If you sell the old bike and take the upgrade money and put it into a new bike, you will often end up with a better bike.
9 Speed is pretty good for longevity and lack of maintenance. Replacing whats worn will be cheaper - probably only chain, cassette and maybe chainrings. If you decide to stay with 9 speed you should still be able to get parts for many years and there are 3rd party manufacturers making some very cost effective 9speed parts (Microshift).
The other option is replace the entire drive train, which adds the cost of shifters, derailleur, and to make it worth while, chain rings and maybe cranks and front shifter.
I would only consider replacing the entire drive train if the bike was failing to meet some requirement - not enough gear range, too much spread between shifts etc. If you have big hills to climb, strong winds to battle and you are reaching for a lower (or higher) gear, it may be time for an upgrade.
Ultimately the question comes down to you budget, and tolerance for spending money. There is no need to spend money for an upgrade, if you want to spend the money, go for the upgrade.