Given your description, there are a few measures that you could use. If the data is time varying (i.e. those polylines are really tracks and you are comparing them to a reference route), you could use something like a simple root-sum-squares to get a good measure.
A more "geo" approach, then Hausdorff distance is a good metric. Its supported in GEOS and JTS, so lots of free software tools (e.g. postgis and spatialite) support it using simple function calls. It may not be a great approach if you have a track that has a lot of "fairly large" excursions, and another track that has one huge excursion and is otherwise pretty good.
You may also want to apply some filtering to this data if its recorded from noisy sensors - a momentary recording "glitch" could make a lot of difference in this kind of "reduce to a single number" assessment.