Fiber Bragg gratings (FBGs) have become a promising sensor element for measuring temperature, strain and other parameters. However, there exists a cross-sensitivity between temperature and strain. An all-fiber sensing system composed of gold-plated FBGs and acrylic FBGs has been proposed and fabricated, which can achieve simultaneous measurement of axial strain and temperature. Using a spectrometer to monitor the shift in the transmission spectrum in real time, the strain and ambient temperature applied to the sensor can be measured conveniently. The experimental results show that the temperature sensitivity of a gold-plated FBG is 3.2 times of that of an acrylate-plated FBG, which can distinguish the temperature changes efficiently. In other words, its sensitivity is increased 2.2 times compared with ordinary fiber grating. The strain sensitivity of gold-plated FBG and acrylate-plated FBG is the same, which is 1.19 pm/µε. The sensor has the advantages of having a simple structure and high sensitivity and can be used to monitor the running state of rail traffic.