On the Relative Importance of Photoevaporative and Hydrodynamic Effects in the Ablation of Self-gravitating Globules in Compact H II Regions