I think there are two separate issues here:
1. I assume you declared your part ownership when you became bankrupt. The Official Receiver (OR) should then have investigated whether you had any equity interest in the property. If there was, the OR should have made arrangements for this equity interest to be realised for your creditors. This could have meant getting the property sold, or putting a charge on it so money could be taken when it is later sold. If you didn't have an equity interest (i.e. if the outstanding mortgage was equal to, or more than, the property value) then the OR would either arrange to disclaim his interest or wait for about 2 years 3 months after you became bankrupt to see if there was then any equity - i.e. if the property value had increased. The OR should be able to tell you what of the above has been done;
2. You say the mortgage lender is trying to get possession. This does not necessarily have anything to do with your bankruptcy. The lender is presumably doing this because mortgage payments are in arrears. I don't see why you need to do anything about it. You will be named on any Court papers because you are a part owner but it is up to the Court to make the decision. Your ex's wish to remain in the property is a matter between him & the lender - if he can get the mortgage up to date, or agree a schedule with the lender to repay the arrears over a period, then the lender may withdraw the Court claim & let him remain. Otherwise, they are most likely to get a Court order, take possession & sell the property. It is important for you to realise that if this happens - either now or at any time in the future - you will NOT have any liability to the mortgage lender yourself. Normally, if a property is repossessed by the lender & then sold for less than the outstanding mortgage, the borrower(s) are liable to repay the shortfall. However, any liability you may have for that is covered by your bankruptcy & you will not have to pay anything if this situation arises.