A federal judge has told government agencies to restore public access to health-related webpages and datasets they removed to comply with an executive order by President Donald Trump.