How can I get categories IDs if multiple categories requested via URI?

Hm hm. WordPress might be good at making this work, but isn’t too good at making it convenient to work with. Typically get_queried_object() is a good way to access such context, but in this case it will merely hold the first term and ignore the rest.

You will probably have to scrape this information out of $wp_query->tax_query->queries, which will hold something like this:

array(2) [
    array(5) [
        'taxonomy' => string (8) "category"
        'terms' => array(1) [
            string (12) "post-formats"
        ]
        'field' => string (4) "slug"
        'operator' => string (2) "IN"
        'include_children' => bool TRUE
    ]
    array(5) [
        'taxonomy' => string (8) "category"
        'terms' => array(1) [
            string (6) "markup"
        ]
        'field' => string (4) "slug"
        'operator' => string (2) "IN"
        'include_children' => bool TRUE
    ]
]