I'm not aware of any other way to make them switch weapons earlier. If the trouble is that they sometimes run into other troops before they charge the first target (and thus have primary weapon out still), then the best solution may be just to watch them carefully and be sure they're trying to attack the closest target you think they'll end up in melee with, which should mean they'll have their swords out in time. If I misunderstood why you felt their behavior is disadvantageous, though, then just let me know and I'll see if I have any other useful advice