Stochastic Acceleration of Electrons and Protons. I. Acceleration by Parallel-Propagating Waves