Only the triangular prism will hold 30 gallons of water.
First, we need to find the volume of the prism.
It is: V = (24 x 25)/2 x 28 = 8400 in^3
Since there are 231 cubic inches in a gallon, so there are 36.4 gallons in the tank. 8400 / 231 = 36.4
The pyramid would only have one-third of the volume.