How do I programmatically set the view title?
If someone else is looking for an answer, Here is how I achieved this.
I implemented hook_views_pre_render and in this hook, I implemented a method of views class setTitle. This allowed me to set the page title. Here is the complete code.

function MYMODULE_views_pre_render(ViewExecutable $view) {
 if ($view-&gt;id() == 'ABC') {
  $view-&gt;setTitle('MY CUSTOM TITLE');
 }
}


Hope this helps.