Leaflet doesn't have a functionality for making such calculations. It only has the distanceTo method for calculating distance between two points. Since you're working with linestrings that wouldn't work. If you really want to do this on the clientside i would look at a library like GeoScript. That library has a distance method in the geom.Geometry class which works with geometries. There's also other methods like contains, touches, intersects, contains, within etc, which could come in handy at some point.
But i'm thinking you'de be best off doing something like this on the serverside using the PostGIS extension of your DB. PostGIS has ST_Distance and ST_DWithin which also calculates distance between two geometries and much more like contains, covers, crosses, overlaps, touches etc. The entire specification and examples for geometry calculations in PostGIS can be found here.