Spend some time went through MD10C User's Manual, I don have this motor driver. No point connect the 5V from arduino to the Vin since it require at least 12V to work. You need to move the jumper to Vmotor. Try to put the PWM value to 255 (maximum) and look at the output.
I doubt your code work properly because the if and else combination is not suitable, at least in your case, press button1 and button2 will have different speed despite the direction. Try analyze your code step by step, you will understand.....
I don check the hardware interface in deep, but definitely the code have problem.
Try explain how your code work, I will explain how to fix it.