What set(s) are the largest by number of pieces? These sets could be retired or existing.
I am also curious what set(s) have the most rails pieces included.
Right now, the largest commercially available train is the Lego City Cargo Train, Set 60052. It comes in at about 887 pieces. There are 30 rail pieces in this kit. Extra rail pieces are also commercially available through Lego. The 7898-1 cargo train would come in second as far as piece count. Same amount of track as the 60052.
Apart from those mentioned by Joe, there are several larger sets in the Advanced Models category. They are not powered out of the box, but can be motorized.
Also, if you need more rails, check out the dedicated rail packages: