A similar situation arises in The Arsenal of Freedom. Geordi is put in command while Picard and Riker are on the planet. Chief Engineer Logan tries to pull rank and assume command, but Geordi basically tells him to eff off.
Indeed, Starfleet seems to put a lot of store by position, and rank seems to actually have very little relevance at all.
This is especially true in Voyager, where Ensign Harry Kim is treated as far more senior than dozens of Lt. Cmdr. ranks walking around the ship. I always found that a bit daft.
Also equally silly seems the fact every commander of a ship, no matter what size or capability, holds the rank of full Captain. In the real military the idea that the commander of a Minesweeper would hold a higher rank than the XO of an aircraft carrier would be mental. One commands 20 guys, one essentially commands 5,000.
It does make some in-universe sense though. Starfleet seems to have a relaxed approach to rank compared to a modern military as suits its sometimes quasi-military portrayal. Terefore Data deferring to Geordi in Engineering is as much about Geordi knowing his stuff and Data's respect for that as it is about Geordi's actual position.
In a crunch, where they disagree, Data's rank would give him the call, but when there is no crunch - it is likely they would all sit and have a meeting, as they regularly did in TNG.