If you are indeed in this spread as a relative value bet, COST being overvalued isn’t the question (that’s true for quite a few names, tbh) - the question is: can WMT appreciate in price compared to COST?
And since 2004, with the exception of 2017 - COST has gained value versus WMT...