US judge orders Trump administration to restore canceled teacher preparation grants