How to get only the last child of category slug?

Create a custom taxonomy for cities, and then use get_the_terms() to display the term slug in the image URL.

ALTERNATIVE

If you’re only wanting the last slug, you can use PHP for that. Place this at the very top of the file just after get_header() :

<?php
    /* Grab the link. */
    $link = $_SERVER['PHP_SELF'];
    /* Separate the url. */
    $array = explode( "https://wordpress.stackexchange.com/", $link );
    /* Count your way backwards. */
    $last_slug = count( $array ) - 2;
    $the_city = $array[$last_slug];
?>

OR

<?php
    /* Grab the link. */
    $link = $_SERVER['REQUEST_URI'];
    /* Separate the url. */
    $array = explode( "https://wordpress.stackexchange.com/", $link );
    /* Grab the second to last element in the array. */
    $the_city = prev( $array );
?>

USAGE: Use the following for your image tag:

<img src="https://wordpress.stackexchange.com/questions/165551/<?php echo bloginfo("url'); ?>/wp-content/uploads/cities/<?php echo $the_city; ?>-140x140.jpg" alt=" " />