Generally, I think the answer would be "it depends on the context".
If the Judge is talking to a Duke (who also happens to be his liege) about something the Duke did that might have broken a law, then it should probably be assumed that the Judge has authority over the Duke.
If he's talking to him about the management of his region, or which army he's in, then the Duke is the one in authority.
If it's something more ambiguous...well, then, that's when things get interesting!