Maximum number of connections allowed to your postgres database is 25. But you have set your concurrency for sidekiq as 25. So if you have all the concurrent threads for sidekiq running, you will not have any database connection available for your app server.
Either reduce the sidekiq concurrency or increase the pool size(I recommend increasing the pool size).
Postgres allows 100 concurrent connections by default