*ahem* F-asterisk-colon-ampersand diplomacy.
There. I said it.
I am totally clearly far too tired to be sitting in front of the computer and skimping out on essays.
The power ranking advice is a good one. If you find yourself lagging behind on power rankings, you are doing something wrong. Or playing at a difficulty level that is too high for you. Prince or Noble is a good place to start.
Or, if those seem not at all the case, then perhaps you chose the wrong civ.
With the early culture boost that a Creative civ brings I find I can maintain and hold the number one... or at the least... third... spot most of the games I play in.
As a result, most civilizations hate me for having a small army and a high ranking.
And not giving them any tribute. Ever.
The second key thing: mobility.
No matter how small your army is... mobility is ridiculously important. So important, in fact... that if you aren't building roads, you need to switch all production you have to workers, build roads, and forget hammers for a turn or two.
Even with a small but dedicated border force you can significantly outpace an enemy army on your own territory, provided that you have a good transportation network.
Thirdly: know thine enemy.
If you've got Montezuma on your border, or any dumb pundit who will never get anywhere scientifically, but can raid your towns arrows of death... keep that border town well garrissoned. If not with quantity of troops, quality of troops. And perhaps consider, as people have said, using that city as a production center.
Fourthly: know your landscape.
Large borders are tough to defend. Sea borders, on the other hand, are far easier. Block off whatever ithsmuses you can leading to your territory with cities or forts. Take over as much territory culturewise so that the enemy is facing one one direction. Fighting a two-front war with few troops is insanity. A one front war, even if the front is large, is likely easier than shuttling units back and forth throughout your empire. And if they try a sea invasion... you hopefully see the transport, and if you don't have a navy to intercept it, at least you can reprioritize units. It takes a turn to land, after all, you've got plenty time.
And lastly:
Keep your units (except one unit per town to keep them happy) outside of your inner towns. Keep them on your borders. If something happens on your inner towns you can likely get them there faster than your enemy. And consider getting a fast horse, not for offense, but to raid into enemy territories and destroying their transitways.
If they can't get to the front, then you've got plent of time to pump out those emergency troops till you can seal a peace deal.