The equivalent version for the first query will be like this:
SELECT sum(numbackends) FROM pg_stat_database;
In the above case, you can expect the first version to be slightly faster than the second one, Because it has lesser rows to count. But you won't be able to measure the difference.
As both the queries are based on exactly the same data, so they will be equally accurate.