Well, the test Troi took is not a "bridge officer's" test, but a bridge commander's test. It's meant for someone who wants the promotion of commander or above, not merely to be on the bridge itself.
The episode never suggests such a thing. Rather, the test only has two known qualities:
1) it gives the person taking it the clearance to stand bridge watches - a menial task usually performed by the most junior of officers
2) it results in the promotion of Lieutenant Commander Troi to Commander rank, and apparently resulted in the promotion of LtCmdr Crusher to Commander rank as well
If a Lieutenant took that test, she would no doubt become Lieutenant Commander; if an Ensign did, he'd become a Lieutenant (j.g.). Indeed, it appears that for example Dr. Bashir already took such a test at Ensign rank, as he stood watches at Lt.(j.g.) and Lt rank. In contrast, Dr. Pulaski or Dr. McCoy apparently never took such a test, and still attained Commander rank.
The various redshirts and yellowshirts no doubt had this sort of training back in the Academy already, and never had to take a test of this sort after graduation... A red- or yellowshirt Ensign or Lieutenant typically stood watches on Kirk's or Janeway's bridges when there wasn't a plot-furthering crisis going on.
Other flag officers were mentioned being from other branches, but seem to have worn the command red.
However, significantly, no flag officer was said to represent the Medical or Sciences branch, excusing the lack of blue uniforms. And AFAIK, we never quite saw any flag officer who would have been stated to come from Security, either. So we can perfectly well believe that Medical or Sciences Admirals would have worn blue, and Security and Engineer ones yellow in TNG and red in TOS era.
Timo Saloniemi