Range is a deciding factor when determining whether/where a raid goes. Also in the original WITP various ship classes were assigned a 'value' and thus helped in determining which ships were attacked. While I wasnt able to confirm this in the AE manual, from what i remember from reading the Witp manual the point values were heavily weighted to CV of any type, followed by BB, BC, CA, CL, AP, and then all the rest. Don't qoute me but i believe a CA was worth 4x more than a frieghter/aux/dd ect...So if there are multiple ML and only a single CA i believe the game system would assign more 'Value' to a ML TF vs a single CA.
Also to be taken into consideration is the Detection Levels (DL) of the two TF. The closer TF will likely have a higher DL than the farther tf (in this case the ML are closer than the CA). In that case the game most likely makes a decision based on the chance to actually find/attack the target. I'm only making an assumption here, but it makes sense in a way. Each raid uses supply ect and so if you launch a raid you want it to hit something. Following this line of logic it also makes sense to hit the closest target since the closer a target is the better your chances of finding it/hitting it are. When combined with a higher DL it seems logical that the computer would decide that attacking the closer target ie the ML would be more likely to succeed, while the diffrence in value of the targets wasn't high enough to make a longer range/riskier strike worthwhile.
Of course I'm new to the game myself so take everything I say as conjecture.