I find it highly strange to assume malicious intent ("flexing"), rather than charitable one (they're just interested in this route regardless of you being on it, or your attempt made this route seem fun/interesting and made them want to try it for themselves).
People seem to assume bad intent all the time when there's obvious equally-or-more-likely charitable explanations, to the point that I wonder if it's me who's naive.
If someone jumps on something I'm struggling with, I take it as an opportunity to really pay attention to what they're doing and try to learn. They might just be way stronger, but they probably also have some better technique ideas.
For #2, I just take it as a slightly awkward attempt to reach out and socialize. Advice isn't harmful. At worst it's a mild spoiler (oh well), or just wrong (then ignore it). At best it's a great chance to learn something.
I'm awkward and it's rare for me to start a conversation, so I just take someone else talking to me as an opportunity to connect without having to make the awkward first step, and try to spend a minute or two (at least) talking with the person.