Regarding the iMac, Hardware capability, price, and what you can get from Windows with the right setup, it kinda depends on what you'll be doing OTHER than using Trainz.
If you'll be doing a lot of work projects / creative schoolwork, a Mac is the way to go. For basic needs like word processing, spreadsheets, browsing the web, and downloading content, a good PC with a good graphics card (Most standard Macs use an NVidia with 512Mb of GDDR5. 512Mb isn't amazing, but its not terrible. Its like a standard).
From the price standpoint, going for the best but cheapest, Windows 7 (8 if you don't mind) + a Core i5/i7 2nd-4th gen processors, 1 GB GDDR5 video card and at least 8 GB DDR3 of RAM should do wonders for you. Inexpensive, but powerful enough to get though Trainz with little to no problems. Plus, you'll be using the standard 2010/2012 edition, not a Mac designed one, so you won't need to worry about "being behind the times". A good quality Windows 7/8 PC with a monitor (assuming somewhere around 23") can cost anywhere from $600 to $1,500. An HP ENVY h8-1445 with the new AMD FX 8 core (instead of a standard 4 cores, we got 8. Effortless multitasking potential here) clocked at 3.1 GHz and 1GB GDDR5 dedicated card, 12 GB of RAM (a good thing, you're getting an extra 4 GB of RAM than the iMac would net you) plus a 2 TB HDD for $1000 total (that's standard, now it's $600, no monitor on either choice) will far surpass what you could probably get from any Mac. Plus it's upgradable, so you won't need to worry about having to buy a new one every few years, just upgrade this one until nothing is compatible (like Windows XP. Keep using it until it no longer works with anything, ever).
If you're going to be doing a lot of creative work (ie: lots of Keynotes, Spreadsheets, Word processing, animation, etc.) alongside Trainz, definitely a Mac. Although the iMac is an All-In-One (which means heat wont be released as efficiently as a standard desktop or laptop) with the right upgrades it'll work wonders. I've taken the liberty to do some looking for you, a iMac @ 2.9 GHz Core i5 gen. 3 with 1GB GDDR5, a 1 TB "Fusion" drive (Roominess of an HDD with the speed of an SSD), Pages, Keynote, & Numbers preinstalled, and 8 GB of RAM (16 adds $200 to the cost) will run you somewhere around 2000 USD. Upgrading this is pretty much not an option, so make sure you "future-proof" it by getting what you may need in the future.
But buy what you think you'll want and need - and for Windows Virus software, avast! Antivirus (paid option) is a good choice. I use the free one and it warns you when a virus/malware/trojan/whatever gets onto your machine. Handy peice of software, I love it.