I see it as a sad older person and vibrant young person thing. As a female I noticed it as a sad old man thing, but really the old guys would try to impart "wisdom" on the young men too.
Again, this is putting the onus on a woman who is being made uncomfortable to just "be nice" for the sake of this stranger's needs, and that is the problem.
It may make a great plot for a movie, but in real life, it is rarely the touching moment of sweetness and understanding that outdated tropes would make it out to be. One example: I had a rare afternoon off, and took a book to a restaurant at the mall. I wanted to read, eat, and then run a few errands, all things I hadn't been able to do for weeks. Well, no sooner had I sat down and opened my book, then an old woman comes over and sits next to me, and announces, "You know, Don is just so proud of me."

I don't know if she was mildly impaired or what. I'd just gotten my food, so I couldn't leave. All my attempts to cut conversation short with, "It's been nice chatting with you, but I'm going to get back to my book/lunch" were ignored. I could hardly eat, and most of my meal went to waste. I managed to escape after over an hour by finally just growing a spine and saying "Well, time to go, bye!" and fleeing. I no longer had time to run my errands, either. When I mentioned this to my mother later, she admonished me with the same argument: "She was probably just lonely! You should feel sorry for her instead of judging her. Was it really that hard for you to give her a few minutes of your time?" Actually, yes. It was. First, there is the immediate inconvenience that I did not want to have a social interaction with this person at that time. Second, my afternoon, and my meal that I could only afford as a special treat, was ruined. But especially, third, that is the message I was raised with, so even as a little girl, I felt I had to "be nice" to the creepy old dude following me around the store asking me my name, or the strange lady who wanted to hug and kiss me. "But it makes them feel better, so is it really that big of a deal?" Yep, it's
Gift of Fear time.
I don't care if it was one of those chatty old ladies, a "sad old man," a lonely grandmother who wants to take the child in my care for an ice cream, an old guy who just wants me to "smile!" I don't care if, on the surface, it sounds cold and selfish. Don't tell me "It's just a small thing, is it really that hard?" Because you are asking people to compromise their sense of comfort and safety. No. It is not my job to make every sad, lonely person feel better when it makes me incredibly uncomfortable, unsafe, or is just really inconvenient.
So OP, I totally agree. It was seriously creepy, and I'm glad it didn't happen someplace where you live, so you constantly have that "What if he followed me? What if he's here? What if I run into him again?" feeling. Don't feel like you have to convince yourself that you "guess it was sweet" because no, if it made you feel uncomfortable, it wasn't sweet. Ugh.