A sandbox doesn't have to be a whole setting but it can be. You could shrink it down to a city, a village, or any location you want to explore. It's a different way of DMing where player agency is maintained. The players aren't forced to pursue a particular storyline but instead have the options to pursue multiple threads of adventure.
A simple explanation of railroading is when the players reach a fork in the road. If they go left they encounter a troll cave. If they go right they still encounter a troll cave. To reach the next part of the story, no matter what the players do for the rest of the adventure they're going to end up fighting that troll. When all roads lead to Rome, it's not a game where choices matter.