there's no protocol-level guarantee of that, both transactions are perfectly valid, signed transactions and it's purely dependent on the good behavior of node operators to reject these
and in fact it is quite common to accept "double-spending" since that is really the only way to increase fees to push through a "stuck" transaction. Otherwise you have to wait an indeterminate (potentially forever) period of time until it exits the mempool of all network participants