If (x+2) and (2x-1) are factors,
then (x+2)(2x-1)=0
=> 2x²-x+4x-2=0
=> 2x²+3x-2=0
But our obtained equation is not equal to your given equation. So I think there is a mistake in your question. The factors would be (x-2) and (2x-1). If so,
If (x-2) and (2x-1) are factors, then polynomial will be
(x-2)(2x-1)=0
⇒2x² -x -4x +2=0
⇒2x²-5x +2 =0
Comparing the obtained equation with given expression,
-(ax²+5x+b)=2x²-5x+2
Hence, a = -2 and b = -2
so, a-b = 0