The only reason the NX-01 was decommissioned was so that it wouldn't have been the first Federation Starfleet vessel called Enterprise. That doesn't mean the NX class itself was a failure.
According to Trek Lit (and it makes sense) The NX was decomissioned because of the Earth-Romulan war where the cost of the NX class was too high to justify production when they could make several cheaper, just as well armed ships for the same price
Actually if we want to go strictly by canon sources, it would seem that the NX class was superceded by the "warp 7 beauties" Reed mentions in TATV. However, that doesn't necessarily mean that the NX class ceased production or that ships of that class weren't still operational after 2161.
EDIT- looks like Guy Gardener and Timo beat me to the punch