Rastojanje between 2 things eg. Between two cars. Rastojanje is 1 meter. Udaljenost eg. From your town to another town is 60km.
I would say we use rastojanje very often when you speak about people or things who are not moving right now or not moving at all. Udaljenost can vary.