I don't know the details about the various node implementations, but I would guess that, in general, transactions with duplicated txids would be rejected and not stored in the mempool and not forwarded to other nodes. There is no rule against keeping transactions with duplicated txids around for possible use later, but I don't know why any implementation would do that.
I don't think nodes check or update the UTXO set for transactions in their mempool which means the transaction with a duplicate txid should not be rejected from the mempool. They update the UTXO set after they receive the mined block and after verification by which time the tx and the block containing it would be rejected.