Your best bet is to use JavaScript as this is a client-side problem.
Maybe you could get your PHP script to create a JavaScript associative array of names and ages and a function to change the age list and put them both in a <script> element at the top of the result page something like this:
<script language="JavaScript">
var person_ages = {name: age, name: age, ...}
function auto_select_age(name)
{
document.age_list.selectedIndex = person_ages[name];
}
</script>
And then in your person select element, add an event handler:
<select id="person_list" onChange="auto_select_age(document.person_list.options[document.person_list.selectedIndex].value])">
You'll have to check the JavaScript because its probably incorrect.
Construct your two <select> elements using meaningful "value" attributes to the <option> elements (e.g. ids) so that they are easy to reference with JavaScript.