I play on immortal and I typically have border cities (and most of my cities for that matter) guarded by warriors/archers/axemen etc until MAYBE the modern era when I decided to upgrade them because I can.
Of course, if an AI declares on you, you should have known he/she was going to do that BEFORE they declared (WHEOOHN) so you should have a counter force ready.