The other day I heard that song from the 70's, "The Gambler.” There's that great line, "Know when to walk away, know when to run."
The song is about one man's take on life but those words hold so true in business dealings. You can spend a lot of time on a lost cause.
Most successful salespeople understand that it is important to recognize situations in which the sale is not going to close. The prospect has already decided. Any further effort is time wasted.
Often the prospective client will allow you to waste all the time you want because for them, this is part of the shopping experience. They want you to "sell" them even thought they have already decided not to buy. So it becomes incumbent on you to realize this and politely terminate the interaction and walk away.