You need to escape, not surrender, for the hero to appear in the tavern. If he surrenders or doesn't manage to escape, it's like losing a hero. I don't know why it's designed that way, but it ends up being a bit more expensive due to having to buy new units. Otherwise, you need artifacts that boost initiative and keep harassing him until he attacks the castle, because he's a very dangerous enemy with teleportation.