How to display multiples jQueryUI progressbars in a page in Drupal 7?
Your first code example for the progress bar has a small syntax error (missing a }); at the end of the line). I'm not sure exactly why your second example doesn't work, (I didn't try it) but this code works perfectly for me using your HTML as an example:

drupal_add_js("
  (function($) {
    $(function() {
      $('.progressbar').each(function() { 
        var val = $(this).attr('rel');
        $(this).progressbar({ value: parseInt(val) });
      });
    });
  })(jQuery);",
  'inline'
);


This code produces:



EDIT

I've just noticed you have some invalid HTML in your code which probably won't help. You're wrapping &lt;h4&gt; and &lt;div&gt; tags in a &lt;p&gt; tag, which is invalid XHTML. It might not be the problem but it would be better practice to change that &lt;p&gt; to a &lt;div&gt;.