How is the H-Index of a journal related to its grouping in SJR?
They are different indices, measuring quite different things, and shouldn't be expected to be highly correlated.


The H-index is simply the number h of articles that have received at least h citations.
The Scimago Journal Rank (SJR) only considers documents published in the journal in the last three years, and weights them depending on the prestige of the journals the citing papers were published in. The idea is that a citation is "worth more" if it's from (what SJR determines to be) a highly prestigious journal. (Interestingly, the prestige factors are determined self-consistently, using an algorithm like Google's PageRank.)



  
  I found instances where a journal with low H-Index got grouped in Q2 and a journal with higher H-Index got grouped in Q4. How is this possible?
  


The H-index is strongly linked to the number of papers the journal publishes, see this answer. Hence, it's quite possible for a small selective journal to get a low H-index, but high SJR ranking. Conversely, a large journal with lower standards is likely to eventually publish enough highly cited papers to achieve a high H-index.


  
  Is this grouping of SJR well-defined?Is it more prestigious to publish in Q1 than in Q2?Is Q1 journal considered to be of higher value than Q2?
  


It's well-defined in the sense that there's an objective algorithm to calculate it, and it seems to do a decent job at capturing the trends in the fields I'm familiar with. A Q1 journal will generally be more prestigious than a Q3/Q4 one, but there might be exceptions, especially as any measure can be and will be gamed. However, if there's say one journal just above the Q1/Q2 cutoff, and one just below it, I wouldn't take Scimago's word for it. While it's useful as a rough guide, it ultimately, like most rankings, is no substitute for experience. Look where leaders in your field publish, where the papers you read are published, and discuss journal quality with colleagues or mentors.