A court has blocked a Trump-era purge of national park displays covering slavery, climate change and Indigenous history.