This is a task that can range between fairly complex to maddeningly difficult, all depending on your data. When I've worked similar problems before I've started out with something like this:
- Buffer one of the datasets
- Intersect the buffered dataset with the non-buffered dataset
- Calculate line length for each segment intersecting the buffer
- Assume that the longest line segment inside the buffer is the one you're looking for
You'll typically end up with quite a few false positives and negatives, but it'll give you a starting point which you can then further refine according to your situation. I'm sure there are other ways to attack this problem as well.