1. GitHub has a valid license to distribute it (as a result of their TOS)
2. Running the downloaded code is not copyright infringement (or not obviously so, and hasn't been established as so in any court that I am aware of)
3. Using the APIs is not copyright infringement (see Oracle v Google, if that was fair use this almost certainly is)
Thus no copyright infringement has occurred.
Still, keeping this in the codebase is at best boobytrapping your code to create accidental future instances of copyright infringement, and it's an interesting case of people not checking licenses (since it's pretty clear they didn't realize this in advance).