Watching over the Luke lightsaber training, it's all right there.
Obi-Wan: Remember, a Jedi can feel the Force flowing through him.
Luke: You mean it controls your actions?
Obi-Wan: Partially, but it also obeys your commands.
Couple that with all the evidence of Ren being severely weakened both physically and emotionally (along with him not wanting to kill Rey in the first place) and it's pretty obvious why Rey "won" the final fight. Still ridiculous that it needs a justification but everything about it is plausible within the film's universe. Ren also wanted a couple of things from her: the rest of the map to Luke, secrets buried within her mind and for her to outright fall to the Dark Side as his apprentice. Perhaps maim and incapacitate Rey, but not kill her.
As for her knowing about the Jedi mind trick? The film shows that the tales of the old films, Jedi, the Sith, etc., have all become legend. Upon meeting Finn and learning BB has a map to Luke Skywalker, Rey immediately knows who he is even as a myth. So when Han later confirms that the myths are true ("All of it"), you're damn right she is going to try the Jedi mind trick. It's not as if it's some secret technique; in RotJ Jabba laughs at Luke's attempt at the Jedi mind trick so it's clearly established as a known ability for Force users.