It took his classmates about 30 minutes to scramble out of the cave to call for help, launching an hourslong rescue, the sheriff said.