The Three Hundred Project: Correcting for the hydrostatic-equilibrium mass bias in X-ray and SZ surveys