A large issue with 2.5 gallons and shrimp is that they are usually uncycled (which shrimp should be living in a cycled tank, because theyre very sensitive..) and because its harder to get away from your betta, which will up the chance of them being eaten. They clean the bottom, but they poop it right back out, too.
Smaller snails, like nerites (minimum 2.5gallons each snail) have a smaller bio load and are quite small.
Snails, however, can protect themselves in this smaller size with their shells, but even they can be targeted, because they cant get away as well.
And in a 2.5 gallon, I honestly don suggest any... You can try 2-3, but theyll probably be eaten.