Judge rules against corrections dept. retirement plan