Judge says state can take over St. Paul inspections