That's just it, though. I couldn't have fought off Kublai. I had maybe 2 units in each city (longbows) and that was about it. Plus, Kublai's ahead of me in tech as well. Most civs are, although prior to the second round of warfare, I was catching up quickly.
Just wanted to say that I almost never build longbows because they are only good at defending a city but they do little to stop a pillaging force which can really hurt your economy. Cats are a great weapon - I recommend you build more. Even if you are not attacking a city they can weaken an entire stack that is invading your territory allowing you to clean up the rest of the units that have been sent and they have a withdraw chance so you might not even lose it.
When you say you are behind on tech - how far behind? It can be nice to beat up someone that has a few techs you want and then make them give them to you for piece. Now if you enemy has calvary and you have macemen then you are pretty screwed. How are you choosing what techs to research and are you trading techs? Like I mentioned earlier try to beeline a military tech right before lanching your invasion. Your enemy has longbows in his cities? Try to push up to gunpowder and maybe chemistry to grab some grenades. If you are playing a warmonger make sure your research reflects that.