Problem getting relationship between entries to work
I recommend doing it like so:

{% set vacancies = craft.entries.section('vacancies').limit(null) %}

{% set catSlug = craft.request.segment(3) %}

{% if catSlug %}
    {% set cat = craft.entries.section('apprenticeships').slug(catSlug).first() %}

    {% if cat %}
        {% set vacancies = vacancies.relatedTo(cat) %}
    {% endif %}
{% endif %}


This sets up an ElementCriteriaModel for all your Vacancies entries (don't use the find() method yet!).
Then checks for the first entry from the Apprenticeships section with a slug of your URL segment.
If there's really such an entry, it further extends the ElementCriteriaModel with a relatedTo parameter.