You cannot be a warrior, so you should not try to be one.
Unless they are geared for spell saves, you will outdamage them using spells every time. Even in the two cases you described, two lightning bolts would have more than likely put you ahead of the warrior.
If the warrior is decked, it's not you playing AP wrong, it's you trying to fight a decked character which obviously has it's own unique problems. I do this too because fairly often if you aren't going for AP charges they are the only ones with any reward for killing, but it's not your class.
Finally, there is an element of luck to every combat, even with the defensive specs that swat aside blows from all weaponry easily. Flee if you take too much damage and pray you don't take that much damage again. Or, get huge reserves of copper and fight next to the town healer.