West Coast Peninsular Malaysia have good train coverage especially in Klang Valley. There are 4 main operator in Malaysia; Keretapi Tanah Melayu (KTM), Sabah State Railway (SSR), Express Rail Link (ERL) and RapidKL.
These are website where you can get your ticket online :