Railway operation can result in the significant environment contamination with heavy metals. The aim of the study was to broaden the knowledge about the railway transport as a source of heavy metals. Railway ballast stones and herbicides were chosen as the objects of the research since these contamination sources on railways are hardly investigated. The location of sampling the ballast stones was a passenger station, which is characterized by the high traffic intensity. The three most common glyphosate-based herbicides and two combination system herbicides of burn-down with other active agents were chosen for the analysis. The heavy metal content in the railway ballast stones was detected by means of XRF, in the herbicides-by means of MP-AES. The railway ballast stones did not contain a sufficient amount of Cd, Co, Mo, Pd, Sn and W for detection. Pb and As were detected at the low concentration of less than 35 ppm only in several samples. The research results showed that the investigated railway ballast contained a significant amount of Fe, Mn, Cu, Cr and Ni. According to the absolute content of HMs in the contaminated ballast layer, they can be arranged in the following sequence: Fe > Mn > Cu > Cr > Ni > Zn > Pb > As. The content of Fe in the contaminated ballast stones was strongly correlated with that of Ni (r = 0.972), Cr (r = 0.954) and Mn (r = 0.943). These metals are components of the railway steel. Therefore, their source can be the abrasion of rails and wheels. All the investigated herbicides contained Cd, Co, Cr, Cu, Fe, Mn, Ni, Pb and Zn. The highest content of Cd, Cr, Ni and Pb was detected in the "Anti field bindweed" herbicide, which can be related to its complicated composition. Compared to the heavy metal content in the ballast stones, the herbicides can be considered a negligible source of these pollutants.