Trajectory inference for equilibrium systems with optimal transport