I don't know if it will work, but it should be safe to try provided you don't install D1 on the RAMPS board - with that diode, the 19V will be supplied to the mega. The mega's voltage regulator is capable of handling up to 20V, but needs additional cooling above 12V. Be sure to turn the pots on the pololus down as far as possible without causing missed steps, and watch out for the supply overheating.