And would probably have survived that. Which means he would have gotten a different test in the first place. Or the test would have been reconfigured in such a way that his presence on the bridge as a commander was absolutely required and going in himself simply wasn't an acceptable option. After all, the point of the test was not to fix the problem, and not even to see if someone would sacrifice their own life, but to see if they could order someone else to their death.
I was basically being humorous. And I think that yes, Data was already a bridge officer. Starfleet has rules of conduct, and Data understood them. But, his actions in "Redemption" showed that he also had that all important quality for leaders: knowing when to bend the rules for the greater good. And yes, knowing when to productively risk lives.
Also, Data might have some problems interpreting 'my first duty is to the ship' correctly:
Data: And, commander, did I pass the test?
Riker: No, because your 'solution' didn't just kill off the entire crew, but every civilian and child, too. In fact, there's no trace of organic life left!
Data: Yes, but the vessel is intact, which is my first duty.
If Data was specifically told during the test that his highest priority was to save the ship, I could see that happening. He can take things rather literally.
But as long as he understood the true conditions of the test, I think he would have passed it. Assuming there was no alternate solution that an android could carry out. Such as making the repairs himself.
In the end, Starfleet seems to have an overall pattern as to promotion. Everyone on DS9 ranked up sensibly, even Bashir (it wasn't mentioned, but they changed his collar insignia). Most of those who didn't rank up (Picard and Riker) were given the chance, but turned down the more prestigious assignments to stay where they were. Even non-Starfleet Kira got a rank boost. So that just makes the Data's and the Harry Kim's make less sense.