P. 22 of the rulebook says: "A ranged attacker cannot disengage except by moving. Although a ranged attack does not cause an engagement, a ranged attacker must still attack an opponent it is engaged with if it is going to attack (unless it disengages by moving away)."
Further down is says "When choosing to break an engagement between units, the owner of the disengaging unit removes the engagement token, and then the unit suffers a Parting Blow as described below"
I understand this as the archer unit WILL suffer a parting blow if it moves away, and the same goes for the unit it is engaged with.
Archers in cannot flank as it is a ranged attack (even if its an attack at an adjacent unit), and flank attacks are melee only. (see p.19 under Place Engagement Token)