As far as I can gather, in the not too distant past, English judges were especially noted for being drunk most of the time. Our cockney brethren apparently took to using this phrase in the ironic sense.
The sober bit meaning being serious. A judge being serious. As drunk as a Lord: not necessarily meaning a Lord from th House of Lords but one that is rich enough to be drunk.