What river would that be? Baltimore is a port city. The railroads junctioned there. They were only marching through the streets because there was no direct rail connection.
I’m curious if you’d respond similarly to the citizens of Baltimore today attacking and murdering federal troops simply trying to transit to the other side of the city.
Washington is on the Potomac. It is accessible from the ocean. Troops from Massachusetts, or from Pennsylvania could have been brought in by ship. The reason to parade them through Baltimore was as a show of force which was NOT well received.