In episode 2 of the anime, the characters start off in the Shiganshina district. When and how did they get inside wall Maria? It shows them on a river barge with other refugees, but I do not think that explains it. Is there a gate on the river for the barge to go through? If so, is the gate ever shown, explained or attacked?
The refugees just sailed into wall Maria. There isn't much more to it than that. As far as I know the river gates were never explained, but they have been shown. In chapter 1 you can see the river flow through the walls and in chapter 73 you can see in more detail how the river flows freely in and out the walls through bars. I assume them to be able to open similarly to the regular gates. They have not been attacked and it has not been explained why. At this point it makes more sense to attack the regular gates than the bars, seeing we don't even known whether Titans can even swim.
The boat wasn't in Shinganshina District, it was in Wall Maria. The people living in Shinganshina had to run through the inner gate to get to the boat. In the anime a Garrison Regiment person yells for everyone to go through the inner gate and that there will be a boat on the other side that will take them to safety. Then the Garrison Regiment sets up cannons in front of the inner gate to protect the people trying to get onto the boat. A couple minutes later the Armored Titan appears, and breaches the inner gate. All the people see that the inner gate has been breached and they realize that their only option is to try to jump onto the boat.
They simply ran through the open gates of Wall Maria and then to the boat. Since Shiganshina was a safe place before the Colossal Titan breached the outer wall, the gate was open. So when the wall was breached the Garrison protected the gate and let the people of Shiganshina inside as long as they could. When the threat got to big they closed the gate (which the armored Titan then breached).