First Last Last First
JavaScript (ES6), 63 bytes



(x,y,a)=&gt;a.map(P=(v,i)=&gt;v-y?v-x?0:a=i:1/(p=a)?P=+P||i:0)&amp;&amp;[P,p]


Try it online!

Commented

(x, y, a) =&gt;          // given the two integers x, y and the array a[]
  a.map(P =           // initialize P to a non-numeric value
            (v, i) =&gt; // for each value v at position i in a[]:
    v - y ?           //   if v is not equal to y:
      v - x ?         //     if v is not equal to x:
        0             //       do nothing
      :               //     else (v = x):
        a = i         //       save the current position in a
    :                 //   else (v = y):
      1 / (p = a) ?   //     update p to a (last position of x); if p is numeric (&gt;= 0):
        P = +P || i   //       unless P is also already numeric, update it to i
                      //       (if P is numeric, it's necessarily greater than 0 because
                      //       we've also seen x before; that's why +P works)
      :               //     else:
        0             //       do nothing
  )                   // end of map()
  &amp;&amp; [P, p]           // return [P, p]


Alternate versions

Using JS built-ins, a more straightforward answer is 79 bytes:

(x,y,a)=&gt;[a.indexOf(y,a.indexOf(x)),a.slice(0,a.lastIndexOf(y)).lastIndexOf(x)]


which can be slightly compressed to 75 bytes:

(x,y,a)=&gt;[a.indexOf(y,a.indexOf(x)),a.slice(0,a[L='lastIndexOf'](y))[L](x)]


Try it online!

Edit: @Neil managed to reduce it to a very nice 67-byte:

(x,y,a,f=s=&gt;a[z=y,y=x,x=z,s+=`ndexOf`](x,a[s](y)))=&gt;[f`i`,f`lastI`]


Try it online!