Once again, careful reading is the death of sceptical criticism. Let's take a closer look at these two verses. I Kings 4:26 says,
"And Solomon had forty thousand stalls of horses for his chariots, and twelve thousand horsemen."
While II Chronicles 9:25 says,
"And Solomon had four thousand stalls for horses and chariots, and twelve thousand horsemen; whom he bestowed in the chariot cities, and with the king at Jerusalem."
Note that in the account given in II Chronicles, the horses and chariots spoken of are specifically mentioned as having been "bestowed in the chariot cities" and "with the king at Jerusalem". Thus, this passage is specifically speaking of the horses which were held in readiness for military action. These "chariot cities" spoken of were strategically placed throughout Israel as bases where the chariots and horsemen in Solomon's army could be quickly called forth to battle. II Chronicles 8:6 describes the building of several of these cities by Solomon. Further, in II Chronicles 1:14, we see that Solomon is said to have 12,000 horsemen, and 1,400 chariots, which were placed in the chariot cities. This correlates quite well with the figures given as bestowed in the chariot cities in verse 9:25 -- same number of horsemen, and a completely logical number of horses which would be needed to both pull this number of chariots, and provide an extra horse for a replacement should a horse be lost in battle or be made unable to pull a chariot for some other reason.
In I Kings 4:26, the caveat that these horses were bestowed in the chariot cities is not made. Thus, this passage is simply a more general statement concerning the TOTAL number of horses which Solomon had in his possession in the state army. This number includes both the number on "active duty" in the chariot cities, and also the "reserves" which were kept elsewhere and which were not made available for immediate military use (this could include foals, breeder mares, studs, those doubly used for non-military state use, etc.) Thus, while 4,000 horses were kept in the chariot cities, another 36,000 were kept elsewhere, not for instant military use, but many of which could (and eventually would) be called up for use with the chariots in Solomon's army.