You would update the table in the second database via postgres_fdw.
But stop and think before you implement a solution like that.
The consequence is that the transaction that inserts the value won't finish before the value is inserted in the remote table. That will slow down the transaction considerably, and if the remote database is down for some reason, your INSERT will fail.
Data duplication is normally a problem. Usually it is a better solution to store them only once. What keeps you from using postgres_fdw to access the data from another database?
postgres_fdwordblinkor listen/notify and local trigger. anyway maybe you are overcomplicating things?..