how to create ambari database backup without enter password
You are trying to connect to a database called ambari this way (when specifying only the -U parameter, the DB name is taken from its value).  

From the .pgpass file it looks you want to connect to the postgres DB.  Specify -d postgres, too, or set

localhost:5432:*:ambari:bigdata


in your .pgpass file.  (As it turns out, there is an ambari DB, so the connection parameters look all right.)

Note that by default this file has to be in the OS user's (in this case postgres) home directory.  Alternatively, you can specify its location in other ways.