BIT prefix max elements update function code

in the update function we are just doing bit[ i ]=max(bit[ i ],val)…now what will happen if the position we are updating was the maximum value till that position before the update and after update we are decreasing its value so that it doesnt remains maximum now.
Eg 1 2 7 5 3 now if we update(3 , 5) in bit[ 3 ] we have 7 and when we are updating we are doing bit [ 3 ] = max( 5 , 7) = 7 so the value doesnt change but 7 shouldnt be in bit