Actually, the C'tis setup doesn't have a rearmost troop - commanders do not count (maybe even bodyguards, too, but I'm not sure about that).
The AI
can attack commanders specifically, so don't be too surprised if the AI does attack the mages in the above setup.
Lacking the existence of 'real' rearmost troops, the Devils simply went for a randomly chosen squad which had some units to the furthest right.
Furthermore, IIRC troops have to pass morale checks for each squad they "pass" on their way to the enemies rear (inverse order of checks vs. Zens model), so it gets increasingly likely that they choose the wrong target the further they advance.
The key to get you own troops to flank effectively is the "hold and attack"-command. While holding for 2 turns, the enemy front line converges on you front line, so the likelihood of your flankers being "drawn" to the wrong target is smaller.
And use fast troops for flanking - mounted troops or flyers. They'll have to pass less checks, which are done at the start of each turn, judging from the comments of some dev.
T'ien Ch'i (or however they're spelled) mounted archers actually work great with the revised "hold and attack"-command (with v2.12 and later). While on hold, they use their compound bows on the nearest advancing enemy, then attack the flank of the enemy formation with their lances. If they don't reach them or the squad is big enough, they'll even fire three or more times. I have actually seen them use their bows when pursuing fleeing enemies - shooting them right in the back from 3..6 squares distance. A very cost effective way to cut off someone's retreat
They
are vulnerable because of low prot value, so try to get either protection or at least Legions of Steel cast on them. Protection makes them vulnerable to fire, but anyone trying to toss fireballs at those fast moving targets puts his own troops into danger as well - most fire spells aren't terribly precise
