Learning interaction kernels in heterogeneous systems of agents from multiple trajectories