Suppose a judge applies ideas of Christiany to judge what's right or wrong about what a person did. Or a judge in a buddhist country applying ideas of what's good custom/tradition for Buddhism. Some trials sustain than people behaving in certain way is against "good customes" or against "moral behavior". Many of these ideas of "good customes" or "moral behavior" comes from religions/belief systems. Has ever been a case anywhere, where an accused person of infringing "good customes" or "moral behaviors" succesfully appealed the case by stating his freedom of religion or freedom of belief rights were being violated? (since he was being judged by ideas of another religion/belief system?). Does a judge applying ideas of a religion to judge, violate the right of freedom of religion?
Typical, a judge can be informed in exercising discretion afforded by secular law by an overall religious worldview without infringing upon freedom of religion (e.g. in judging what sentence within a range should be imposed) but may not cite to religious sources as authority for that decision.
Many countries, however, have an official religion which is binding and supersedes secular law, and in those cases, application of religious authority is allowed and freedom of religion is not recognized.