I would guess if you have level 7 troops then you probably have been playing a long time so would think that you have some understanding of the game.
I do not know exactly what happened , but a battle is not just about the numbers of troops.
You probably know that if you loose the battle there is little information to be seen, but if you win then you get the comparison of strengths.
You did not mention what kind of troops the winner had , but I suspect they were not a mixed bunch like yours were.
The other things possible are Heroes and Shaman and there is the new achievements alongside boosters for the opponent and reducers against yours, VIP level, all kinds of somewhat 'hidden in plain sight details', that potentially affect the outcome.
Oh and i just noticed your numbers seem off, 3000 loss of each from 1000 of each?The primary defense of the town is the peace shield, and the secondary defense is any troops you may have there, needless to say, if your shield drops then you can pretty much say goodbye to most of what is in the town.
The good news is you will be able to heal troops if you have sufficient infirmary beds to hold them, and enough resources to do so.
This will depend on the level of your vault, which protects a certain amount from being pilfered, the bad news is(unless it changed in some update since way back when) it wont protect any silver once you get past palace 5, and then again until you get to I think palace 21,or if you have any stached away elsewhere, or until you can accumulate more resources, as there is no time limit for healing to commence.
As to hero experience and associated strength.
Prioritising the choice of hero's equipment will be beneficial, as will be what you do with the accumulated skill points
Levelling up depends on two things , how quickly you can accumulate resources, and how efficiently you spend them.
This in turn will depend on your style of play how much time you spend playing and if you spend real money, how much.
As there is a set pattern to follow,there isn't much leeway in the game when it comes to developing the town, which in turn determines the level of the oracle and the knowledge you can research there.
There is some leeway on choice of research once you get to the oracle,but there also structure which you have to follow.
The prime sources of hero experience are battles,killing invaders and the standard tasks, there are others which will mean being in clan, involve luck during the game, or some kind of payment, like having VIP.
Apologies if I have missed anything out, but its a long time since I started playing, and there have been additions to the game which will have affected the pathways available.
Knowing what I know now,if I were just starting, I would be able to make faster/better progress, however I probably wouldn't even bother to start playing in the first place.