The gemarah (Shabbat 33b) states that when Rabbi Shimon bar Yochai and his son Rav Elazar were hiding in a cave a carob tree miraculously sprouted from which they ate. How could they eat from this tree within the first three years of its growth, for doesn't that transgress the laws of orlah?
Another answer (suggested here in the Sefer "Kerem Efraim") is that because the tree was created through a miracle, it was not obligated in Orlah. He brings support from the Radak (Malachim Beis 100:4) who writes that the oil that was miraculously created for the wife of Ovadia did not require Maaser to be separated from it.
He explains that for the first three years of a tree's life, the powers of evil rule over it and this is the basis for the prohibition of Orlah. However, the Gemorah (Sanhedrin 59b) writes that nothing impure descends from heaven, and therefore the tree miracoulsy created for the Rashbi could be eaten from immediately.
Reminds me of this (Sanhedrin 59b -- summarized and text below):
Rabbi Shimeon ben Chalafta was walking on the road when lions met him and roared at him. Thereupon he quoted from Psalms: “The young lions roar for prey and to beg their food from HASHEM,” and two lumps of flesh descended from heaven. They ate one and left the other. This he brought to the study hall and propounded: Is this fit for food or not? The scholar answered: “Nothing unfit descends from heaven.” Rabbi Zera asked Rabbi Abbahu: “What if something in the shape of a donkey were to descend?” He replied: “You ‘howling yorod,’ did they not answer him that no unfit thing descends from heaven?”
מי איכא בשר היורד מן השמים אין כי הא דר"ש בן חלפתא הוה קאזיל באורחא פגעו בו הנך אריותא דהוו קא נהמי לאפיה אמר (תהלים קד, כא) הכפירים שואגים לטרף נחיתו ליה תרתי אטמתא חדא אכלוה וחדא שבקוה אייתיה ואתא לבי מדרשא בעי עלה דבר טמא הוא זה או דבר טהור א"ל אין דבר טמא יורד מן השמים
בעי מיניה ר' זירא מר' אבהו ירדה לו דמות חמור מהו א"ל יארוד נאלא הא אמרי ליה אין דבר טמא יורד מן השמים
(Edit: Oops realized someone already referenced this!)
Rav Yisroel Reisman suggests in Parshas Kedoshim (5779) that
1) Rav Shteinman says that Ba'xur is not really edible. It is not a normally harvested fruit. The Gemara says that it is Kashe L'guf K'charavos. I don't know how that fits with other Gemaros, but at any rate this is what he says.
2) When HKB"H put a Ba'xur tree in a cave, Hashem miraculously created a three year old tree. It was in truth just a day old but Hashem created a three year old tree.Teshuvas Chacham Tzvi in Teshuva Tzaddik Gimmel or so, he has a question if someone creates a Golem whether that person can count for Minyan. He does not deal with the fact that that person is not 13 years old. If he created a Golem he is one day old. This is because if someone is created miraculously as a 13 year old, then he is a Gadol. If a tree is miraculously created as three years old then the tree is past Orlah.
In my opinion has said above, since this tree grew “al pi ness” there is no issur orla bound to it; also since it was fully grown -like a 4 years old tree, obviously a miracle- there should not be any issur. On top of it, if HKB”H sent these fruits to save their lives, He “managed” to give them some eatable stuff, and not any issur.