A Montgomery County judge who is accused of improperly releasing a prison inmate is set to retire by the end of the year.