I always considered a second officer etc. is just appointed by the captain. Picard had Data as second officer. But could of appointed Troi that. Since she did have the highest rank for bridge officers (minus Riker). Crusher is not a primary bridge officer.
But could of appointed Troi that... Crusher is not a primary bridge officer.
I wouldn't call Troi a primary bridge officer either.
Do remember that both of them would have advanced degrees to hold the positions that they're in. That alone would give them extra rank I would think.
edit: My vote would be whoever held Tac or whoever held Engineering, depending on the season. I know in ToS, it seemed to flip back and forth between Scotty and Sulu and both of them were seen to hold the bridge when Kirk and Spock were gone.