S5 is an older phone. It came out earlier this year. Its a great phone but, I would go with the Nexus. In terms of resale, its probably going to be about the same. Resale is kind of hard to predict especially when these carriers are pushing the non-subsidized phones in favor of their new programs like the AT&T Next and Edge. At one point, these carriers will need to get rid of these phones somehow and flood the resale market.
When I sold my IPhone 5, even though I cleared around 400, when I bought the phone it was 299+tax+activation fee which came out to around 400 which means that I broke even or lost a little bit of money. I sold my IPhone back in February. I was expecting a much higher resale for the 5 then what I got so, I was a little disappointed in the end.