Quantum beats and localization of two atoms in the subwavelength regime