If you buy a used cart, and it happens to have Trojan batteries (they used to have the majority of the market for all fleet golf carts), there's a quick and easy way to determine how old they are.
Take a look a the terminal on one of mine:

Right next to the threaded terminal, there's a lead "stump" next to it, with a letter and a number stamped into it.
The letter corresponds to the month:
A - January
B - February
C - March
D - April
E - May
F - June
G - July
H - August
I - September
J - October
K - November
L - December
The digit represent the last digit of the year.
So in my case, my batteries are dated October, 2018. Other brands of batteries often have a date sticker on them.
If you want to see what's involved in swapping out the batteries yourself, I put together a video here:
https://youtu.be/DurCRznI97IThey are heavy, but it's a pretty straight forward job otherwise. Happy shopping!