Google can still index based on links to these pages.
Below is a passage from Google support: (https://support.google.com/webmasters/answer/7440203?hl=en)
The page was indexed, despite being blocked by your website's
robots.txt file. Google always respects robots.txt, but this doesn't
necessarily prevent indexing if someone else links to your page.