First, your suggestion that a simple comparison of the forces should determine the outcome of the battle is completely historically accurate. Most battles are determined by the relative strengths of the forces going into the conflict. In the rare event of a weaker side winning, due to good fortune or good generalship, it will be spoken about more often, giving the wrong impression that this is a common event.
It seems to me there are two ways to calculate losses:
"Game world" Frequently in the world of gaming it seems to me that the losers are wiped out entirely. Each battle is thus a fight to the death for the opposing forces.
"Real world" In the real world, a battle might be lost, but (and this really depends on many things) in many cases about 90% of the manpower survives, from ancient to modern times. Some wars have seen 50% of ground troops killed (but far less for artillery and other branches) but this is after they have participated in many battles, or the insane over-the-top policies of World War I trench warfare.
When it comes to taking a city, it really depends on whether or not the city is in a siege situation. This was much more common in the fortified towns of medieval times. Part of the reason why the World War II battles of Stalingrad and Berlin are so famous is their dramatic quality - both involved a siege situation with no escape for the defenders. This, however, is not the normal fare, and retreat from a city is much more common with most of your troops intact.
Before making a suggestion of how to calculate the matter it is important to know how the game play occurs. It sounds like a simple calculation is made and there is no time passing for the players during a battle. If there was time passing (a battle 'in progress' as it were) then one side could pull out as they see how the battle is going. That does not seem to be how your game goes.
How many survive ("real world" now) depends on whether or not the defending troops can get out if they lose, which is normally the case. Also, a general will suffer greater losses if they think the battle is worth more, or they just bloody well want to beat the other guy, so this is a possible user setting you might consider going into the battle ('enthusiasm'?).
Calculate the attacker's total attack force and and the defender's total defense force. If it is a fight to the death (the simplest calculation) the loser ends up with 0, and it is not unreasonable to say that the winner's remaining resources adds up to the original difference between the two. Lets say the winner has 10000 points worth of material left over (whether attacking or defending). You have three choices:
- Distribute evenly based on the proportions of the forces going in. If half of the winner's points when they went into the battle were tanks, then half of them are left over.
- Distribute randomly: it does not matter how many were tanks entered the fray, but be careful that no more than this number comes out!
- Distribute based on opposing forces. If 100,000 tank attack points met 70,000 tank defender points and the defenders lost, then 30,000 points worth of tanks remain to the victor. BUT! The attackers may have lost the overall battle, so this is trickier to implement.
I tend towards the last one, though I frequently make life more difficult for myself! The first is the most straightforward.
Finally, if it is not a fight to the finish, then any of these choice can be applied to a proportionate loss in each sides forces. How about deciding the winner the same way (simply comparing forces, this is presumably fine if each side does not know how many the other is investing). Defenders have a certain advantage (as long as they can run away in the event of a loss) but you already reflect this in the attack/defense point awarded to each element. This is where I would argue with your awarding 0 defense points to a rifle. In fact, if dug in, a rifle has more defense value than attack value. Ask the snipers left behind to help troops evacuate a lost city!
This nod to the real world, where each battle is not a wipe-out, is also easy to calculate. Perhaps 90% survival is too slow for your game (or maybe it means the games are not stupidly short!?!?), but you could experiment with other proportions - winners retain 75% of forces, losers retain 60% (losers would normally retreat before being overrun or surrendering). Then apply one of the three methods listed above to the remaining forces.
The only way to really test the correctness of the proportions you choose is by trying it out by playing the game with those numbers. The wipe-out approach could ruin games with only a few cities, but might simplify games with dozens of cities. In the proportionate approach, retaining 90% of forces each time might be too slow, but too low might as well have a wipe-out. Also, if both sides only lose the same proportion (say 50%) this is really a loss for the greater force which has lost more (though this is frequently the case - see here).
I hope this has been of some use.