There's about a thousand different ways the authors could prove they did the work. Many are listed in the actual post. Unless you did all the work yourself, didn't apply for a grant for it, kept all your work quiet from your colleagues and institution, didn't hire anyone for the project, didn't request materials from your institution, didn't have coauthors, sent it to an editor with a bad memory, didn't use the proper submission system, didn't back the files up and lost your computer, didn't send preprints to any of your friends or colleagues, and the editor reviewed it themselves without sending it to anyone else, you aren't going to have the slightest difficulty proving it is your own work. On the flip side, the plagiarist isn't going to be able to do any of that.