How can I use AJAX in child theme template?

It has nothing to do with child themes, the problem is here:

add_action("wp_ajax_nopriv_x_before_process", "x_before_process");

Notice the nopriv, this is for logged out users, but it’s likely you are logged in

This needs adding:

add_action("wp_ajax_x_before_process", "x_before_process");

Note that this would not have been an issue if it was built using a more modern AJAX API such as the WP REST API