What am I?

I come with a train and go with a train and the train doesn't need me but can't go without me.