Tanks (and pretty much all wagons) are usually rated by their maximum allowed weight (the limiting factor is usually due to axle loads,
For example UK 102t (TDA/TEA and earlier) tankers are limited to 102 tonnes because they are bogey based wagons and standard bogies were defined as being allowed 25 1/2 tonnes per axle, so 4 axles (2 bogies) results in a maximum weight of 102 tonnes, however, that's gross weight, and includes the tank wagon itself... In the case of a TEA that usually amounts to about 30 tonnes for the wagon, leaving around 72-73 tonnes of liquid that can be carried...
So, the first step is to find out the rated capacity of the tanker you're interested in, that's usually fairly easy to find - railfans love documenting all these numbers.
You can then work out the load of a tank full of a particular liquid based on the API of the liquid involved, for crude oil its API results in a weight of 7lbs per gallon, so back to the TEA example, 72 tonnes of crude oil is 158738 lbs, or approximately 22,600 gallons of crude oil.
If you wanted your tanker to carry lighter petroleum products, or even non-petroleum products or LPG, then you'd need to find the API gravity for the liquid in question, and then calculate the pounds-per-gallon figure for it.