Direct Sync Agent installed correctly but service was not able to start, errors from Event Viewer logs:
The On Demand Migration Directory Sync Agent service failed to start due to the following error:
The service did not respond to the start or control request in a timely fashion.
A timeout was reached (30000 milliseconds) while waiting for the On Demand Migration Directory Sync Agent service to connect.

30 seconds timeout was reached.
Increase timeout limit to 60 seconds with the below steps:
In Registry Editor, locate, and then right-click the following registry subkey:
a. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
b. Point to New, and then click DWORD Value.
c. Type ServicesPipeTimeout to replace 'New Value #1', and then press ENTER.
d. Right-click the ServicesPipeTimeout registry entry that you created in step c, and then click Modify. The Edit DWORD Value dialog box appears.
e. In the Value data text box, type 60000 which equals 60 seconds, and then click OK
Restart the agent server. You must restart the server for Service Control Manager to apply this change.