In my book Organic Chemistry by David Klein, 2nd edition, the book shows that the oxygen atom first takes a proton from an acid, then, the conjugate base of the acid takes a proton from the nitrogen atom, in the second and third steps of the mechanism shown above. However, I believe that an intramolecular reaction where the oxygen atom takes the hydrogen atom would be more kinetically favored, due to the fact that intramolecular processes are much faster than intermolecular processes.
My question is therefore: Why is the reaction pathway proceeding through the acid deprotonation/protonation more favored than the intramolecular reaction?