It represents a big legal victory for the Republican president-elect ahead of his return to office next year.