Far as I can recall, minecarts aren't ever mentioned in the books. According to a quick search, minecarts in real life were first used in the 1500s, a couple centuries ahead of the time period the setting of Middle-earth is most similar too.
That being said, there's far more anachronistic things in Middle-earth, and minecarts fit rather well with Orcs and Dwarves.
Though their portrayal in the Hobbit movies, as well as most other things in them, is of course decidedly non-canonical.