If you've decided that you are interacting with the person on the phone instead of with the cashier, then that's that. The cashier can't serve you if you are refusing to converse or acknowledge them. I've seen several people talk on their phone, ignore the poor worker, and then become indignant when the cashier tries to finish the transaction so as to not keep a dozen people waiting. Lots of special snowflakes do this.
Either you talk with one person or the other. If you can manage to talk to both at once, good for you, although this can be rude in its own way if done badly. "Sorry, I'm busy, I'll call you back in just a minute" works fine. The bottom line is, it's rude to talk on your phone when someone else is trying to talk with you.
This is hardly an unreasonable store policy. If someone has decided that they are not going to finish a transaction, then it is quite reasonable for the cashier to stop trying to do what is being prevented, and move on. I don't see this as rude in itself. I like places that proactively put up signs with such a policy, to protect their workers against entitled overgrown brats who would otherwise make their day a lot harder than it has to be.