Rescue workers spent 40 minutes trying to free the boy after the travelator's safety mechanism failed.