From my experience, if you are in the UK, Canada, New Zealand, etc. the proper way to refer to a "judge" in court is "my Lord" or "my Lady" depending on the gender of the judge in question. In the US, lawyers use "your Honor" (US spelling of course).
When recording judgments and writing about judges and there judgments, etc. the judge is referred to based on the local procedures and practice, for example, (US) Justice of the Supreme Court, Federal Court Judge, (UK) the Honourable Lord Whatchamcallit, etc..
Cheers!