If you want to get these blocks naturally you will find them in the chest of Mineshaft underground along with other rail structures.