Crusher outranked everyone on the ship in the sense that she was the chief medical officer and could order anyone around if it pertained to their health and well being.
Picard and Riker were obviously the top two people on the ship. Having Crusher and Troi holding commanders' pips complicates things as yes, they are commanders in rank but not by full-time position.
Data, who as one of his primary functions aboard the Enterprise was as its second officer, would appear to be the default #3 aboard ship, despite the fact that Crusher was always a commander during the series as was Troi near the end. So its a question of position and context.
Romulans are attacking and Picard and Riker are stuck on the holodeck blissfully unaware as they romanticize about jazz and women with a knockout in a computer generated gin joint: Data is the ideal person for command.
A crazy plague is taking over the ship and incapacitating the crew by basically getting them drunk off their asses: Crusher would be the person to default to in order to cure everyone.
You would, I think, never see a situation where Crusher or Troi would pull rank on Data after his years of experience just for shits and giggles. Note also that Data always, ALWAYS referred to the two by their titles of "Doctor" and "Counselor" and would likely have maintained this formality should they be in command.
Still, even in the bolded
situation, the chief medical officer may still be in charge of the medical situation, but you still want a command or support person in charge of the ship to take care of all of the rest of the things going on.
, regarding your example from "Hero Worship", the following is a better explanation.
The Festivus Toad wrote:
A higher rank telling a lower rank what to do: order
A lower rank telling a higher rank what to do: suggestion
Picard could have still ignored Data's "suggestion" of lowering the shields, but at his own peril. One of the things you learn about command is learning when to blindly trust a subordinate.