A federal agency terminated a $3.9 million grant Wednesday that funds library and museum programs across Washington.