I vaguely remember an episode of TNG where a Starfleet ship was hailed and that person addressed himself as the captain of that vessel, however, the rank on his collar was that of a commander. I'm not quiet sure which episode it was but I'm 75% positive I saw it. Now, whether or not he was the highest senior officer or just filling in for him, I don't know, but all I remember is that he addressed himself as the captain and no person of captain rank was mentioned. From what I remember the part was really small, a single 20-second conversation between the Enterprise and some random other vessel.
Despite there being no proof to actually back this up, the scene stuck in my mind because it made me think of the USN where people who hold the rank of commander are captains of some vessels. However, maybe this is proof that this tradition does exist in star trek. Also if you recall in DS9, Sisqo held the rank of Commander for a while. It would be interesting if Star Trek ever actually adopted this tradition because it would open up a whole new type of command structure concerning vessels deemed less important by the federation.