The situation you describe isn’t so clear to me. On the one hand, you refer to having had your application for § 24 rejected and having 3 months to stay in Germany. On the other you mention § 47 AsylG. This law applies to persons who have made an asylum application and who have to live in initial asylum seeker reception centres (Aufnahmeeinrichtung) and for how long. § 47 does not provide a status or permission in terms of staying in Germany (for up to three months or longer). You also refer to a hearing at the migration service and to permanent asylum.
Firstly, you have a month from the date of rejection of § 24 to appeal the decision. I presume the rejection was based on the fact that you were not resident in Ukraine before February 24th 2022 and that you have a residence status in another country (Hungary). If your residence document for Hungary is still valid, then I think there is less chance of success. If it is no longer valid, however, I would write the appeal with the argument that you no longer have residency rights in any other country and cannot return to Ukraine.
From what you write, it seems you may have already made an asylum application. Do you have a paper called an ‘Ankunftsnachweis’ or ‘Aufenthaltsgestattung’? If you have made an asylum application, then you have to await your hearing with BAMF (the immigration authority). Based on your hearing, BAMF will decide whether to give you a refugee protection status or reject your asylum application.
There isn’t really such a thing as permanent asylum. A residency permit based on a successful asylum application is not permanent and has to be renewed every few years. After a certain amount of time in Germany and provided certain conditions are fulfilled, one can apply for permanent residency here (Niederlassungserlaubnis). This is not an option for you at this moment.
I hope I have understood your questions sufficiently to give a useful answer. Let us know if it is still not clear.