The calculated distance (air line) between Ujar and Baku is approximately 118 miles respectively 190 kilometers.
By car or train, the actual journey to Baku is certainly longer, as only the direct route (as the crow flies) between Ujar and Baku has been calculated here.