They are separate.
Trail rations are made up of foodstuffs that are preserved or that can otherwise be stretched out to last over a long journey. They are compact and easily stored. Water isn't something that can be preserved in such a way — it can't be compressed and, obviously, you can't dehydrate it. Water kept for too long becomes unpalatable, and may be a vector for disease. Moreover, travelers need more water than food, as dehydration sets in before hunger and starvation would.
In sum, the amount of water one needs for a day's journey takes up more space than a corresponding amount of food, and so "a week's worth of water" would be inconvenient to carry on one's back or pack animals in a way that "a week's worth of food" would not.
Problem 1 - rations are listed by weight, while barrels are listed by volume
Problem 2 - D&D uses American units, which makes the math less obvious.
So, step 1, gather data.
1 pound ≅ 0.45 kg
1 gal ≅ 3.8 liters
food tends to run a specific gravity between 0.8 and 1.5, with some exception on both ends.
So, with a 2 lb ≅ 0.9 kg; 2.2 lb ≅ 1 kg
At a rough SG 1.1, that's about 1L
40 gal ≅ 152 l
thus about 152 rations
If it's a 1 lb ration, it's about 304 rations in a 40 gallon barrel.
In either case, packing loss for cuboid solids in a barrel is about 20%... so about 120 rations at 2 lbs., or 240 at 1 lb.
And note that typical barrels are good for molasses or honey at about SG 1.45, so the barrel can handle about 220 kg total mass, or about 484 lbs. Both have high viscosity, tho, so don't leak through the joins... Anyway, above about 500 lbs, the barrel ends are unlikely to hold.
As for which, looking in the PBR, as it's been updated. Says 2 lb, so I do believe that's the correct and intended answer. It also matches my SCA camping experiences with hardtack, sausage, and cheese. (2 lb saussage, 5 lb cheese, and 2 lb crackers for 2 adults and two children for a weekend, with both adults plus sized, and me fighting.)
Best Answer
I have a decent third-party source, "Rationalising Rations", by S.E.Mortimer, published in Pyramid magazine in November 2005. It's no longer available on-line, but I have an archive copy. Here's a summary:
A trail ration for a day that's reasonably nutritionally complete for humans would weigh 2.5lb, plus packaging, consisting of 0.5lb each of:
Hardtack: This is the same stuff as is sold nowadays as pilot bread or ship's biscuit. It keeps indefinitely if kept dry and free of insects, and doesn't taste bad, but you need water with it, and it is pretty dull. Grinding it will turn it back into flour, which you can then cook with. The "cram" in Lord of the Rings was clearly hardtack. Tolkien would have been familiar with it from his WWI service, since it was part of British Army rations at the time.
Meat or fish jerky. This is also familiar; without modern packaging, it keeps for a couple of months, more if it is salted and/or smoked. It's best made with very lean meat, which is easier to dehydrate. Dried tofu is an alternative, but is very dull.
Dried fruit, dried peas or beans, and nuts. The peas or beans are best made into soup or stew in the evening with some of the jerky. They keep for about three months, if they're kept dry.
Dried pickled vegetables. Again, soup, and a three-month life if they stay dry.
Cheese. This needs to be dry, hard well-matured cheese, preferably sealed with wax against moisture. It tastes a lot more interesting than modern American cheese. Lunch, it keeps for a couple of months. Dried yogurt or milk curds will substitute.
Historical variations and substitutions have included:
Replacing the fruit, nuts and vegetables with more hardtack, which is OK, if dull, for 2-3 weeks, but then you get scurvy.
A full pound of polished rice or other grain will substitute for half a pound of hardtack, but needs much more preparation time.
A pound of Pemmican will replace the jerky and dried fruit, and has more calories, but won't keep in warm climates.
Other things you want to carry to make life better are tea and/or coffee, salt, spices and alcohol. Carrying beer or wine around is a mug's game; rum, brandy or whisky are much more portable. Having the party cast Purify Water every day will cut down dramatically on the problems that would realistically result from collecting water from streams, from parasites to cholera.
One real-world food that makes a good racial variation is spirulina. This is a type of blue-green algae that has been eaten in Africa and Mexico for centuries. It's dried, powdered and compressed into "bricks." A 0.5lb brick will mostly substitute for 7lb of dried pickled vegetables; don't eat more than a few spoonfuls a day, since it tends to concentrate heavy metals, and contains far too much nucleic acid to be a dietary staple for humans. If you're using this in place of vegetables, you also need another 0.5lb of hard tack, since it's short on calories, and you need fruit or fresh meat, since it has no vitamin C. I found spirulina on sale in my local supermarket as a "superfood", at about $4/oz. It's much cheaper anywhere you might be using it for rations.
Another variation is "Travel bread", also known as "waybread". This is made from a mixture of grains (wheat, rye, barley, etc.), with dried fruit, dried meat, nuts and dried vegetables added. This is pretty much an all-in-one traveller's meal, tastes pretty good and needs no preparation, but it only keeps for a week or so, and it's heavier, because it contains more water than hard tack: you'll want about 3lb/day and it gets dull if you have nothing else. The "lembas" in LotR removes the weight and storage life problems.
Addendum: here's a link to a Tumblr post of details and photos of suggested customised rations and other meals for a variety of races.