Efficient Amortised Bayesian Inference for Hierarchical and Nonlinear Dynamical Systems