Is it possible to use txid_current value for sync
I would tag each inserted row with the current transaction ID (txid_current() or, from v13 on, pg_current_xact_id()).
The “latest safe change” is the right before the xmin of the “current snapshot”, which can be found with txid_snapshot_xmin(txid_current_snapshot()) (or pg_snapshot_xmin(pg_current_snapshot()) from v13 on). That xmin is the transaction ID of the oldest still active concurrent transaction, that is, everything older than that is done and visible.
This should make it fairly easy to build a replication system.