Yes, some men are just being polite, but I think you are also very likely encountering cocklodgers, (if they're younger/around your age,) and men looking for a nurse/a woman to be his housemaid, if they are older.
I had a man in my village last summer walking past my driveway and chatting to me, complimenting me every time he went past, telling me I was very pretty, and my garden was lovely, bringing me flowers around (out of his garden) and just being a bloody nuisance to be honest.
After the first few times I was like 🙄inside. Smiling outwardly but sighing inside...
After the 7th time he was about to pass (this was all in the same few days) I called my husband out, and asked him to help me get something out of the garage. This man saw him and his face hit the pavement. He didn't know I was married. The man had lived in my road - 7 doors down - for about a year and a half, yet had never noticed there was a man and a woman living here. He thought I was alone. He couldn't get away fast enough, and never walked past our house again.
A week later I saw a post on our village Facebook page from one of the people at the Church... 'Hello everyone, Mr Andrews who lives alone in Lindon Road has recently lost his twin sister to cancer, and so he is looking for someone to cook him dinner every evening, to take him to town every Wednesday, and to do his washing and ironing and some light household duties. A small fee will be paid, but Mr Andrews cannot afford much. Contact Reverend Alexander.'
Mr Andrews was this man. He was in his early 60s and had always lived alone (since he and his sister's parents died 30 years earlier.) His sister had lived a mile away with her husband, they had one son who moved to Spain 10 years ago. She had done much of his cooking and cleaning and housework.
Cheeky bastard had been 'chatting me up' because he was trying to flatter and manipulate me into being his housemaid, cook, and skivvy. 
.