They are both slushboxes. So I am assuming you are not interested in selecting your own gears.
Given that, the golf might be the better choice, if and only if the transaxle has been recently replaced and you have documentation to prove it.
Otherwise, for the same money, the Jetta is worth consideration as it has half the miles.
Now: do you need a TDI or will a gasser work best for you?
If your commute is relatively short, and you are wondering, then go for the gasser. If you are ready to buy wrenches you don't already own, and you like the idea of learning about your car and doing all your own maintenance, then by all means, get the Golf (but for those miles I'd not be interested in paying more than $3500 without the above mentioned documents).
You will also be needing to do more searching and reading as to what to expect when you buy a used car. You can almost always safely assume that the owner isn't being 100% upfront about everything, and that major maintenance is now due, nearly due, or overdue. That means fun little jobs like the timing belt need doing now. Plan for expenses like that. If they aren't in your budget, go look for a bicycle.