When you borrow something from the (secular) library does it follow the same halacha as a loan from one Jew to another?
As a general rule, in monetary matters, there is no difference between dealing with Jews or non-Jews; and in both cases the (written or oral) agreement between the parties is binding.
Notable exceptions are:
- Ribis: One can never charge interest to a fellow Jew; certain types of interest are allowed when dealing with non-Jews. See the Rambam in הלכות מלווה ולווה פרק ה for details.
- Mistakes. If a fellow Jews errs, one must inform him and ensure he's paid in full. If a non-Jew errs in his calculation - and you inform him that you are relying on his calculations and there is no chance of him discovering his error and a Chillul Hashem being caused then you can pocket the extra money. See the Rambam in הלכות גזילה ואבידה פרק יא:ה for more details
So in your case: all the rules of the library would apply and you would have to abide by them. However, if they make a mistake, then the rules in #2 above apply.
E.g. If you are late in returning a book, and they charge you a late-fee, and they err in the calculation, you do not have to correct their arithmetic, you can simply say "are you sure that's the amount?" and then pay the reduced fee.