Foil fencing and lightsaber fighting are two different things. Lightsabers would be more like longsword with the sweeping strikes, two hands on the hilt, and wide open field of engagement. Sometimes it delves into a one handed sabre style of fighting (Dooku), but even then it's a huge departure from foil fencing.Now that's a good point and I have another real world experience as an example.
I was an amateur fighter. Not exceptional in any way -- won some, lost some -- but experienced enough. After I retired from fighting due to age I took up fencing out of curiosity.
I had held swords before, even had 'duels' with other people who had little or no formal training that came down to athleticism (timing, reflexes and all that jazz) -- so I was already fit with decent timing, eyes and athleticism, relatively calm under attack.
First time I picked up a foil and faced my formally trained and experienced instructor, he showed me how quickly I would die.
Very, very quickly.
So on the one hand I want to hand wave Rey's duel away as her being an experienced fighter using the unfamiliar lightsaber as a staff (for thrusting) against a badly wounded opponent.
But now you have me remembering how utterly useless I was against a trained, competitive fencer that knew what he was doing in spite of years of combat sports.
I've been in HEMA (longsword, saber, shield and buckler specifically) for about 5 years now, I see new fighters score the occasional hit against experienced ones, even ones who have won tournaments.
When you factor in that Kylo was wounded, and Rey overcame her fear and let the Force guide her, it's more believable, that she could of beaten him.