For hydrogen, the mass of the gas itself is negligible compared to the weight of the tank used to store it in compressed form:
Therefore, an advanced composite container holding 5.7 kg of CH, would provide a range of 300 miles in a hydrogen vehicle, but will require a storage space of 260 liters (69 gallons) and weigh about 230 lb (104 kg). This will then be about nine times bulkier and three times heavier than a typical 7.5-gallon gasoline tank. (https://www.fsec.ucf.edu/en/consumer/hydrogen/basics/documents/task2_gaseous_h2.pdf )
So what you get overall is on par with the best batteries that are becoming available - which however have much better volumetric energy density. This is especially important at higher speeds: the energy required to accelerate a large mass can by recovered with a high efficiency using regenerative braking, while the friction of a bulky vehicle with air is lost (alternatively, passengers will drive a larger vehicle than required since the internal space is insuficient).