using wp_head in body tag for css style

It’s not working because you’re calling add_action after the actual action is fired. If you move the action declaration before wp_head() it will work:

<html>
     <head>
     <?php
     add_action( 'wp_head', function () { 
          echo '<style type="text/css">.sc_title {color:#fff; font-weight:600;}</style>';
     });
     ?>
     <?php wp_head(); ?>

There’s no easy way to add some code to the head from the body tag as that code would be evaluated later. If you really need to do so you can play with output buffering (evaluate first the body template and buffer it) but I can’t see why you should.

In reply to the latests comments:

If I’ve understood right what you want to achieve is to have some css being put in the head when a shortcode is add in the content, right? In that case you might add a check in the header for the content of the post. If it match a given shortcode then you output your styles. You can add something like the following to your functions.php, but it’s kind of an hack:

add_action('wp_head', function () {
    global $post;
    if ($post) {
        setup_postdata($post);
        $content = get_the_content();
        preg_match('/\[my_shortcode\]/', $content, $matches);
        if ($matches) {
            echo '<style>.some_style { font-weight:800; }</style>';
        }
    }
});