Judge rules in Pima County's favor in state funding dispute