It is the 2014 Nebula who makes it back to 2023, 2023 Nebula (the one who initially travels back) is still being held in Sanctuary II. This is made clear by 2014 Nebula's previous line when she first meets Thanos in 2023.
Nebula (2014): Yes, Father. So, this is the future. Well done.
The 2023 Nebula came from 2023 so she would already know the future and that line wouldn't make sense. Also this Nebula just betrayed the Avengers after joining them to take Thanos down. Thanos' mission was already successful so it would seem odd to help them then sabotage the mission after it was successful.
It's also made clear which Nebula makes it back earlier on as 2014 Nebula takes 2023 Nebula's gold head band thing to disguise herself as the 2023 one. The Nebula that arrives back in 2023 is wearing the gold band so it must be the 2014 one.
There are other signs that it is the 2014 Nebula that initially makes it back and brings Thanos and the Black Order to 2023 but I don't think we need to cover them all.
It is then 2023 Nebula that kills 2014 Nebula down in the tunnels. Again clear by the fact that 2023 Nebula arrived with 2014 Gamora after 2014 Gamora set her free and 2014 Nebula was in the tunnels looking for the Infinity Stones and she has just told Thanos she has them.
Gamora (2014): Stop.
Nebula (2014): You're betraying us?
Nebula (2023): You don't have to do this.
Nebula (2014): I am... this.
Gamora (2014): No, you're not.
Nebula (2023): You've seen what we become.
Gamora (2014): Nebula, listen to her.
Nebula (2023): You can change.
Nebula (2014): He won't let me.