When a balloon is filled with hydrogen gas, its weight is less than the weight of air displaced by the balloon.
The balloon rises as a result of the additional upthrust.
However, as it rises higher, the density of the air decreases and upthrust decreases until it is equal to the weight of the balloon, at which point it stops riding further.
Density of carbon dioxide is much more than the density of hydrogen.
Hence, when a balloon is filled with hydrogen, the weight of the air displaced by an inflated balloon or the upthrust tends to become greater than the weight of the gas balloon that is filled causing it to rise.