In the majority of cases, I'd recommend that you do nothing. Unless the answer is literally copy-pasted from another answer on the page, you're just going to incite debate and all for what purpose?
If you don't think the answer is helpful, don't upvote it. If you think the other answer is helpful, then upvote it. It's as simple and easy as that.
If you want to leave a comment suggesting that, instead of posting a duplicate answer, you should simply upvote/comment/edit the other answer, then you should feel free to do that. You can even downvote the answer if you wish. But do be careful when making this call of copying; it's quite a hefty accusation.
In the case you highlight, I really don't think that the answers are duplicates of one another. Yes, they show basically the same sample code. But if that is the way of accomplishing the desired task, then it makes good sense that they'd show the same solution. Their explanation is slightly different, and that's the part that really counts.
If anything, it looks like Jay's answer should be a comment on Devjosh's answer, but since they didn't have the reputation to post a comment, they left an answer instead. Not really a big problem here, since their answer actually does answer the question, which is precisely what our instructions to them request. There's nothing wrong with posting a similar answer to a question, so long as you provide new or additional information not provided by the existing answers.
But whatever you do, don't flag it for moderator attention. Moderators can't do anything about this you couldn't do yourself (i.e., leaving a comment) except outright delete the answer. I don't really think that's an appropriate solution, but beyond that, there's a more general problem: You should not put mods in the position of having to make these types of judgment calls. That's not what they're for.