Judge rules against Northamptonshire library closures