https://github.com/SomeoneElseOSM/osmimport_02 (which I wrote for my own use) does this. It does a lot of other things as well though; I’m not sure how easy it would be to use it to “just split tracks”.