Having 30 units to attack them at that stage in the game is silly . You don't need 30 units . And you certainly don't need 10 siege units and 10 missile units , 3-4 each at most. missile units unless they in a good place for sniping aren't great on the offensive. My usual attack force is 4-8 melee , couple of mounted if it will help , 0-2 missile , 2-4 siege and a general if you got one. Plus a couple of workers for roads and destroying terrain.
It doesn't help you picked a hard target at a bad time , great wall plus the timing of your attack makes it a bad target you should avoid , great wall is annoying , especially if you don't know how it works. Unless you have a good reason you shouldn't be fighting this war if there's an easier target..
The AI isn't richer just because it has small bonuses on king , look at how they improve there land and there policies. The AI focuses more on gold than a good human player . They pay for it in other ways and in the long term.
My advice is never have 30 units that early in the game , never have 10 siege units (until late when your rich) , use missile units for city defence or sniping from a good spot. Composite bowmen and a walled city are a really good efficient defence at the start. Roads help a lot.
The main advantage a human has over the AI is upgrading units and promotions, that is the key to beating the AI at the higher difficulties above king. Either at trebuchet's or cannons you should have your army in place ready for war , upgrade them instantly you get the tech then go on the offensive and win.
Usually an AI will attack you first , this is what you want , you mop them up on the defensive with a small army and then when you attack they have little defences. You shouldn't be losing units often , keeping them alive for promotions and upgrading is key.
Remember little things , don't build units to have them sitting around waiting for a war, have them in the build queue 1 turn from building. The perfect army size until you are rich mid-late game is the minimum you need to not be destroyed , without losing more than the odd unit.
I usually like to have roads built to my main targets for a quick attack (not always possible) it helps a lot. So does destroying forests that blocks siege from firing.