Do they serve the same purpose ? If not what's different ?
The SLG strut (found on B773ER) is a truck position actuator on steroids.
The truck position actuator is used to bring the landing gear truck into a position suitable for stowing in the wheel well. This is true for all Boeing aircraft.
The SLG (Semi Levered Gear) strut on the B777-300ER is additionally used to increase T/O performance. During T/O the wheel truck is locked perpendicular to the strut, shifting the point of rotation from the middle of the truck to the aft wheel. Thereby the rotation pitch can be higher and the tail clearance during rotation is increased by about 30cm / 12in.
After selecting gear up it behaves like a normal truck position actuator, moving the landing gear truck into stow position before the gear is retracted. During landing it is disconnected and serves only as a shock damper.