On the generation of ion beamlets in the magnetotail: Resonant acceleration versus stochastic acceleration