Funny two of you have mentioned the long lines at St. Lazare station - I ran into that too (this was back in 2013). I arrived much too late to wait in a line and still make the next train (the one after that was an hour or two later). Although there were ticket machines at St. Lazare, they were not working - I had a true chip and PIN credit card that worked at other machines.
My solution? Just get on the train without a ticket. No, I wouldn't do that in every country (not Italy!). Yes, I asked the conductor standing at the door if I could do this, and she said I could buy a ticket on the train - I'd just have to pay a premium, an extra fee 20 euros extra or something. So that's what I did. No one ever inspected my ticket by the time I got to Vernon, so I didn't even have to buy one.
But, I think it's still good advice to show up at St. Lazare station early so you don't have to worry about buying a ticket. Or, maybe buy it (if you can) online on your phone, with the SNCF app, which I didn't have in 2013.