Who owes the other person money?

My brother bought a car and he didn’t want it anymore. So he gave the car to my mom. She was gonna pay him the insurance & money he put towards the car.

He then needed to buy another car. Since she wasn’t here, I loaned him the $5k for a down payment on the car.

All of a sudden she wants to give him back the car.

And no one paid me back yet.

Who owes me the money? My mom or brother?