Here's what i would do. When i have to face necromancers i never bring treants to the fight. I get why you did it because necromancers don't have a bonus vs heavy melee. Treants however, only have a bonus vs light melee, and you're not fighting light melee. I would bring 3 squads of golem II and 2 squads of sorceresses. The necromancer may have a 60% bonus vs heavy ranged, but they get killed fast by golem II. You can use the sorceresses to curse the necromancers to reduces their damage done. Golem II has a massive 80% bonus vs heavy melee, those knights don't stand a chance. Witht their 40% defense bonus vs short ranged, that squad of archers won't do much harm either. Go for the necromancers first because their curse is nasty. When that's done, you can kill the knights, and golem II kills a lot of them each turn, plus their own spell will increase the damage of the next golem II attack. Your sorceresses can keep cursing the knights so they won't do much damage. That squad of archers can come last since both your units have a good defense against it.
But i agree that sometimes, the enemy is way too overpowered. A slightly bigger battlefield would help too, because sometimes i can't move my units at the start of the battle because of obstacles, giving the enemy the chance to strike first, and they do hit hard sometimes.