The Higher Education Act together with The Ordinance on Students’ Unions (Studentkårsförordning) regulate the status of student unions, states that they should be run in democratic ways, and lays out their mission in exerting direct influence over education. The ordinance also regulates the appointment of student representatives to the board of governors. The legislation states that a student representative represents all students at the relevant HEI, not only those who are members in a union.
The legislation makes no distinction between doctoral students and bachelor and masters students. However, in practice, one area where conditions are different for doctoral students is compensation for the work. The Association of Swedish Higher Education Institutions provides guidelines for how prolongation should be handled for doctoral students involved ins student representation. These guidelines are not binding, and universities may do things differently. You can find the guidelines here.