the general rule is 1" of fish per us gallon of water
so for the 2.5 you can have 2.5" of fish, for the 5 you can have 5" of fish.
doulbe the tank size, double the no of fish.
now bear in mind that most of the really small fish such as tetra's and rasbora's need to be kept in groups of 6+, a group of 6 of them would be far too much for the 2.5 and would be a heavy stocking but bearable in the 5 gal tank.
in the 2.5 you could have a trio of guppies.
mollies and swordies get a bit big for either tank.
a betta could work in either (although i think they do much better with 5gals+) but they need to be kept in a tank by themselves.
the other thing to consider is not just the no of fish you can have but the stability of the tank and the maintenance it takes. the larger the body of water the more stable it is, this means that it's easier to take care of, a v small tank like the 2.5 is v unforgiving, if you forget weekly maintenance or over feed by mistake then you'll most likley nuke the tank. The 5 gal will be a little more fogiving.
all this being said though, really i'd advise looking for something more around the 20gal mark, it'll be a whole lot easier to handle and you'll have a lot more options for fish.