I finally got the code that shows the result I want. It is the following (macros.html.twig file):
{% macro nav_loop(page) %}
{% import _self as macros %}
{% for p in page.children.visible %}
<li>
<a {% if p.routable != false %}href="{{ p.url }}"{% else %}{% endif %}{% if p.children.visible.count > 0 and loop.length > loop.index %} class="submenu fa-angle-down"{% else %}{% endif %}>
{{ p.menu }}
</a>
{% if p.children.visible.count > 0 %}
<ul>
{{ macros.nav_loop(p) }}
</ul>
{% endif %}
</li>
{% endfor %}
{% endmacro %}
I’ve included the loop.index condition to get the result I wanted.
Thanks for your help, anyway.