Trigger function to update data from one table to another table with different servers in PostgreSQL
There are couple of ways to deal with this using triggers


FDW wrapper as stated by a_horse_with_no_name and use PLpgSQL
use an un-trusted PL language such as PLpython.  


FDW: depending on the version of PG can be fast or extremely slow.  

PLpython requires python language with psycopg library to be installed.

I like to use plpython as its easier to add logic if the connection between the two servers becomes broken,  When the connection is broken use another table to hold onto the pending changes,  then use PgAgent task to retry updating the data.