A young girl was freed after a three-hour rescue when she became trapped beneath rocks at a popular Dartmoor beauty spot.