You probably don’t want to add the sorting logic to your twig template to keep your templates maintainable.
The easiest way is to create a list of users sorted by age in your controller and pass the sorted list to Twig.
You can also look into creating a twig extension for filtering the users. If you create a sort_age filter, you can then use this filter in your Twig template to sort the users array:
{% for user in users|sort_age %}
<td>{{ user.name }}<td> <td>{{ user.lastname}}<td> <td>{{ user.age}}<td>
{% endfor %}