Hello, thanks for reporting this bug. In 1.2.4 I did a lot of changes around collision masks in order to stop the cannon shells from colliding with spidertron legs. However, I cannot replicate your issue so it is presumably caused by a conflict with another mod. Would you be able to upload a save game, or at least a list of mods? Are you using Space Exploration?
On the other hand, this behaviour is sort of intended... as mentioned in https://factorio.com/blog/post/fff-362 (under the heading "Spidertron avoids rails", see also https://forums.factorio.com/viewtopic.php?p=518364#p518364 and https://forums.factorio.com/viewtopic.php?p=518371#p518371) spidertrons are not supposed to be able to step on tracks. Does this at all match up with what you are seeing? Of course, unless the tracks are extremely densely placed, spidertrons are supposed to be able to cross tracks easily.