In writing a literature review, assume you have the paper X and the paper Y. The two are similar in the study and the results. How can I write a review in this case?
It looks that it is an example of two independent studies that obtained similar results so you might comment that this reinforces the claim that the reported results are correct. However, most probably the studies weren't exact replications so it might be good to mention the differences between the studies.
It is also a good idea to investigate the journals they were published in - maybe the earlier paper was published in some obscure journal and the second one appeared in a high impact factor one? Have you looked at 'cited by' numbers (in Google Scholar)? Which paper got more citations? Maybe there are some publications that mention both papers? This might give you a clue how the community finds both papers and which one made more impact. It is also plausible that one paper got bigger publicity simply because of more known authors/research group.
I would just say "We have the following result in the following setting", tell the scientific part of the story, and finish with "see  and  for details". No matter what you do, my advice is not to try to claim that someone "did it" and the other one "repeated it" or "did it later" or that the results were "obtained independently". With a three year difference in publication time (some papers take longer to prepare and to review and it certainly takes more for an average paper to get "widely known"), you never know what exactly happened and it is neither your duty, nor your right to make any "educated guesses" on that account unless you have some tangible evidence at your disposal.
This is basically the same as Peter said (only in stronger language). You may launch a small "private investigation" along the lines Rabbit indicated to satisfy your own curiosity, of course, but it is definitely way beyond your reviewer duties and nobody really expects that.
Without knowing all the details it is not possible to provide equal amounts of detail in an answer. Since we (you) do not know the background of these papers it is also problematic to try to say anything to separate them. It is, for example, possible that they were mde independently bt one wtook much longer through review. we simply do not know. We cannot therefore cast judgement. I think it is ffair to simply list them both in a citation without saying anything about who was first, the publication date will definitely put one before the other.