Judd Trump took the deciding frame to overcome Mark Williams in the Saudi Arabia Snooker Masters final.