Optimisation select with large IN and millions of records in result
You might get bitmap index scans and better performance if you increase work_mem to something like 200MB or more, so that a bitmap for your table fits into it.
Other than that, the only remedy I can see is using more parallel workers by raising max_parallel_workers_per_gather.
But all these optimizations are questionable if you plan to run more than a single concurrent query on this tiny machine.
UPDATE:
Experiments with enable_seqscan = off suggest that PostgreSQL overestimates the cost of an index scan.
So if you lower random_page_cost to something closer to 1, PostgreSQL should choose the better plan automatically.