Maybe your calendar is not instantiated if you moved the script in the master page.
Debug: Open Developer tools, click on console.
Change your javascript function to:
function ValidateDate(sender, args) {
console.log(sender);
var selectedDate = sender.get_selectedDate();
console.log(selectedDate);
console.log(document.getElementById('HiddenField1'));
document.getElementById('HiddenField1').value = selectedDate;
(document.getElementById('dummybtn')).click();
}
Check if anything is undefined (and you'll immediately see if the function is called by seeing the messages in the console).