There are a number of causes for this, however, take a look at the simple things first that can cause this.
The biggest culprits are your antivirus program and disk space.
For your antivirus program, you need to exclude trs22.exe and your user-data folder from your antivirus real-time scanning.
Check your available disk space. Click on This PC and look at the graph showing how much space your drive contains versus how much is used.
Trainz requires lots of space for not only your route but also to decompress assets in order to load them into your route. Trainz also creates a temporary copy and a backup copy of your route when you work on it. If you don't have a lot of disk space, this can prevent Trainz from saving properly if at all.
And finally, if everything checks out, try a database repair. It could be a simple as that, but I would check the antivirus first.