Indeed during a bankruptcy proceeding there can be a process to ask to have the student loan discharged during the bankruptcy due to hardship.
As you mentioned, the student loans generally do survive bankruptcy; but there is an adversary proceeding that can be used during the bankruptcy in cases of hardship.
"If you file Chapter 7 or Chapter 13 bankruptcy, you may have your loan discharged in bankruptcy only if the bankruptcy court finds that repayment would impose undue hardship on you and your dependents
. This must be decided in an adversary proceeding in bankruptcy court. Your creditors may be present to challenge the request. "
This is not a procedure that can be used after the bankruptcy is settled or the court enters an order closing the case. At this point, the case is no longer active.
Only when a bankruptcy is in the court can the hardship be claimed. If you do have an open case or are considering filing
a new case the attorney should be consulted to include the request during the case to discharge student loans due to hardship.
Hope this helps to explain that the case has to be open and a processing is done during the case for the discharge of student loan due to hardship.
Please ask if you need more information or discussion.