The emergency funding came after the National Endowment for the Humanities canceled most existing grants, part of a pivot toward President Trump’s priorities.