The lawsuit comes as lawmakers in an increasing number of conservative states push for measures making it easier to ban or restrict access to books.