Solution:1
You can try this code:
const optionsValuesToKeep = $('input[type="hidden"]').val().split(','); // is ['3325','3326','3323','3322']
$('#datetime_0_cars > option').filter( // jQuery filter not vanilla-JS filter
(index,optionElement) => !optionsValuesToKeep.includes(optionElement.value)
).remove();
It splits the hidden input’s value attribute into an array, gets all options, filters out options that should be kept, and removes the rest.