The "Flagship" designation is only given to the highest level capital ship in your fleet, regardless of when it was built (1st, 2nd, or 10th). No capital will have this designation if there are two (or more) capitals with the same level and they are all the highest leveled capitals.
In the Empire Tree, if my memory is accurate, the caps are sorted by level, then order of construction. If you had all level 7 capitals, for instance, they would be sorted in order they were built from oldest to newest when they're all in the same gravity well.