A Cape Cod nonprofit organization has secured a $2.5 million federal grant to restore and preserve the health of a river of immense ecological and communal importance to the Mashpee Wampanoag Tribe.