Mountain bike cables and road bike cables use different ends. When you go to buy replacement cables some come with a mountain bike cable end on one end and a road bike cable end on the other end.
When you bought the replacement cables, did they have fitting on both ends? Did you look at and match up the cable ends before cutting the other end off?
Some cables are sold with just one end. Did you buy the right cables?
And, as already been mentioned, shifter and brake cables are different sizes, and also use different ends for mountain bikes and road bikes.