Posterior marginalization accelerates Bayesian inference for dynamical systems