How to run JavaScript function in WooCommerce checkout?

I had exactly the same need, because of the ajax checkout validation.

Woocommerce has some custom javascript events we can hook to.
In reCaptcha specific case we need to hook to checkout_error that is triggered when the ajax call fails.

So, I solved with the following code in my own javascript file, besides the PHP custom validation hooked to woocommerce_checkout_process:

jQuery(document).ready(function($) {
    $( document.body ).on( 'checkout_error', function() {
        grecaptcha.reset();
    });
});

Hope it helps.