Gallons refer to volume, so any 2.5 gallon container will hold the same 2.5 gallons of water as any other 2.5 gallon container!
I'm not sure in exactly what unit you could come to any different conclusion... since 2.5 gallons of water in one container also WEIGHS the same amount as 2.5 gallons of water in another container, so this is confusing to me, but I guess not everyone comes from the same background and while it's obvious to some, may not be obvious to others, that 2.5 gallons is the same 2.5 gallons no matter what shape the container is. If you can measure out 2.5 gallons of water, and pour 2.5 gallons of water into the container, then it holds 2.5 gallons.
Hope that helped?