Its not trash its sediments, Nicaragua unilaterally decided to clean the sediments from the bottom of the river.
Where they left the "trash" is a protected are due to its biodiversity.
Costa Rica told them, "hey thats Costa Rica, get off" they answered, "no, we stay here" Keep in mind Costa Rica doesnt has an army
It is an illegal military excursion, the Costarican government pointed this error to them directly an thru the OEA and asked them to remove their military forces from Costa Rica immediatly, they refused!!
When Costarican aircraft make flybys near the area, Nicaraguan soldiers point their guns at the aircraft.
Things are getting quite serious here, and most of it is because the president of Nicaragua, Daniel Ortega (google him) wants more votes in the upcoming election.