There are several Bible passages which are almost identical. In this case, it is most likely that both passages are borrowing from a common source document.
There is a small discrepancy in the two passages. Jeremiah says that Jehoiachin was freed on the 25th day of the 12th month, whereas 2 Kings says it was on the 27th day of the 12th month. Either this is a copyist error, or the process of Jehoiachin’s release took three days: the announcement was made on the 25th, and he was actually set free on the 27th.