EDIT: I am NOT, however, tolerant of Data remaining a LCDR as a result. He did more to deserve that third gold pip in one season than Deanna did throughout the series. And if Deanna and Beverly could be commanders, certainly the third ranking officer on the ship could.
<At the yearly performance review, sitting against Riker and Picard>
Data: Captain, I have noticed that both dr. Crusher and counselor Troi have been promoted to the rank of Commander, whereas I, third in command, still am a Lt. Commander only. May I ask why, sir? Have I not served this ship satisfactorily?
Picard: Let's just say that, despite your assertions to the contrary, we have never found you fully functional in quite the same ways they are.
The Riker condition is pretty silly when compared with the real world. In the US Navy, a ship the size of the Enterprise would not only have captains (O6) as both commanding and executive officers, both would have experience as commanding officers of smaller vessels. Riker would have legitimately already had his first command and would have been of equal rank of Picard, although below him in the chain of command.
Or, if they absolutely had to be of different rank, why not give Picard one leg up, and make him a Commodore? Still has to answer to all those evil Admirals, but clearly outranking most of the other CO's of lesser vessels in the fleet (e.g. useful when taking command of the fleet in First Contact).