you can't take out a mortgage on the flat, unless you have got, or share the right to buy as defined in my link. If you have got the cash, you can give it to your mum to do whatever she likes with, or make her a loan on the same basis but the house becomes hers absolutely and you can't make the load on condition that the house becomes yours on her death.
"There is nothing in law that specifies how a Right to Buy purchase should be financed. A family member (or someone else) could provide the funding for the purchase. However legal ownership of the property can only be in the names of the eligible tenant/s and other eligible applicants."
http://righttobuy.communities.gov.uk/do-i-have-the-right-to-buy/
This means that if your Mum needed residential care, the house could be taken into account when her finances are assessed, also if she chose to leave it elsewhere or died intestate (have you got other family?) you would have no legal argument about the ownership, although any loan amount would be taken into account.