With a real-time database, each worker could subscribe to be notified when the set of tasks changed, but it would require a separate locking mechanism in the application to ensure that each task is only attempted by one worker. (Imagine a scenario in which a task arrives when there are multiple workers idle.)
With RabbitMQ, you ensure* that each task is only attempted by one worker at a time, and you don't have to do anything special to ensure that at the application level.
*I'm simplifying a bit, there are edge cases where e.g. you lose a worker that has already started a task but not completed it.