Lifetime measurement of molecular states with an accelerated ion beam