In my opinion using buttons will be more ergonomical or efficient to use. Buttons demand less work from the user, because all the distances will be displayed, and the user won't need to play with the slider to see the different options.
When interacting with the buttons only 1 click will be necessary to complete the action, while the interaction with the slider will demand selecting the slider moving it left and right to see the available options and then positioning it in the right place. That's 1 user interaction for the buttons vs 3 for the slider.
However, I don't know the domain and context of your app and sometimes it would be better to use slider if the context makes it the better option. I'm just telling you that using the 4 buttons will require less cognitive resources than the slider, but that's it. In order to really see which is the better option in your specific case you should do user tests or A/B tests.