There were numerous ways Ezra could have used the Force to regain access to the ship after he and the others were locked in the cargo hold, from using the Force to manipulate the control panels they couldn't physically reach, to using it to physically remove the barriers blocking their path.