Most scrap yards won't purchase those or anything related to the rail road unless you have documentation authorizing you to sell the rail roads scrap metal.
I wouldn't touch the spikes and would just leave them. Not worth going to prison over and you can get major prison time probably up to 20 years in prison for the theft of rail road property.