The mortgage agreement will be in the names of the RIO homeowner and they're responsible for the monthly repayments and it will come out of their bank account. If you decide you want to give them money for this there's nothing to stop you, but a lender could factor the payments you're making into their affordability assessment and it could affect your borrowing amount.
For more information on monthly payments, check out our detailed guide here.