As a grad student I find that many relevant books (e.g., Springer) are available via uni subscription, or some pre-print version is available for free.
Libgen is useful and textbook publishers are nuts, but educational organizations are enabling them and they could do that less, surely for below-grad-level material
On a tangent, the tendency of Indian universities adopting syllabus from its US counterparts leads to use of proprietary software like Matlab. Software companies in US supply student version of their software and often tie up with the university to get it into the syllabus. But its much harder for Indian students to access the same software. Some universities have identified this problem and have recently started prescribing open source software like Julia and KiCad.