Based on your system specs, I'll go on a limb and assume this is a laptop or similar machine such as an all-in-one.
The issue is caused by the system being starved of the resources needed for merging. Large routes take a lot of memory (RAM) and with only 8GB of RAM, that's only the beginning. You should have at least twice that in a system these days. To make matters worse, your GPU uses RAM taking up a chunk out of what little RAM you have installed.
Your hard drive space is quite small and quite tight on space. Trainz like other programs creates temporary files while performing tasks. Operations such as merging require a lot more space because Trainz will create a duplicate copy. Depending upon the size of the routes, this can be a substantial amount of disk space taken up by the backups. Without a lot of RAM, your operating system will swap programs to disk in more temporary files as it shuffles resources around to make RAM space.
The solution to successfully merge large routes is to increase your RAM, if possible, and create a large page file. The problem is you don't have a whole lot of disk space to work with and that's a no go. You could do a hard disk clean up to remove temporary files and back up any unneeded documents, pictures, videos, and downloads to start.
A permanent solution may be to move your Trainz data-folder to an external drive and keep your very small internal SSD as your program-only drive. This will give you enough space to increase your page file.