The Track Relayer is a special Minecart that can replace existing tracks with other tracks.
To do this, you need to place the type of rail that your track is currently made of in the left slot. In the right, you place the type of rail that you want to change it to and in the 'Stock' slot place the required rails to change.
When the Track Relayer stops replacing tracks it means that it has run out of tracks to place and needs refilling. The removed rails will be automatically dispensed from the base of the cart.