Yes, foreign keys are implemented using triggers. Here is a blog post explaining a little more: http://bonesmoses.org/2014/05/14/foreign-keys-are-not-free/
I would assume it's still got to do a seq scan even on every referencing table even if it's empty for every record since there are no indexes. It is not free to do ~25k seq scans on that many tables.