The wording is too vague, ask your GM how they read it
Quick googling didn't get me any official ruling, perhaps there just isn't one. So let's try to analyze the text, the only part that (very unclearly) tells us what should be done for the bonus to stay active:
You must hold the flag in one hand in order to grant this bonus.
One could argue that if you are holding your flag with two hands, you are also holding it with each of the hands. Like if you have Charisma of 20, you also have Charisma of 16 and Charisma of 15 and qualify for the feat, so it is OK to attach the banner to a two-handed weapon.
If that doesn't pass, you could attach it to any one-handed weapon and then you could qualify for holding that with one hand.
A very strict GM could then say that if a flag is attached to something, you are not holding it with your hand, you are holding the thing it is attached to. That strict GM could just quote the flag's description saying that "Carrying a flag in combat requires a free hand", and perhaps actually name the intent: you trade one free hand for a small bonus to everyone in 30 ft. radius.
That same strict GM could also argue that while Banner of the Ancient Kings can be attached for a weapon and qualify for the Flagbearer feat, the artifact lays special emphasis on this possibility, while the Flag (10 gp item) doesn't.
An even stricter GM with some taste for absurd situations could argue that to qualify for the Flagbearer feat while using the Banner of the Ancient Kings you need to carry the Flag (10 gp item) in one hand, and the Banner of the Ancient Kings in the other hand, perhaps attaching it to something. To me it sounds like a perfect solution (no).
All in all, again, there is no official ruling I could find, and the wording of that feat is very, very vague. Ask your GM to get the answer.