The nodes will remove the second transaction that tries to spend the same input, but it's by no means a guarantee that the first transaction will be included in a block. When it comes to new transaction, full node's task is to propagate them through the network with a goal of eventually reaching all miners, and miners are the ones who actually decide which transaction to include in blocks. Generally they will choose the one with the highest fee. So, in your scenario when you try to get conflicting transaction to propagate through the network, you might have a scenario when when part of the miners know about transaction A and the other part knows about transaction B, but even if some miner knew about both transaction, they would never include both of them in a block, because such block would be invalid and rejected by network.