An online person claims that they can't leave Ghana unless they fly out first class. They already have $3000 and claim that isn't enough to buy a ticket and leave. Is this legit?
If it is an online person, it is almost certainly a scam.
If this was a real person, the best solution for them would be to contact the embassy, consulate or interests section for their country1. The embassy will help with the repatriation of their citizens, usually in the form of a loan for a ticket home. The embassy is in a position to verify identity documents.
If it is not a real person you know in real life, do not reply to the request, and be aware that your communications so far mark you as a gullible person. Expect more scam attempts in the future.
1 There is not always an embassy, but there will be arrangements. An interest section is a department in a third-party country which agreed to handle diplomatic affairs.
EU citizen can go to another EU embassy. Commonwealth citizens may find help in British embassies.