First create a VLAN interface on the trunk ports with the correct vlan id.
ros code
/interface vlan
add name=vlan2-sfp1 interface=sfp1 vlan-id=2
add name=vlan3-sfp1 interface=sfp1 vlan-id=3
add name=vlan4-sfp1 interface=sfp1 vlan-id=4
add name=vlan5-sfp1 interface=sfp1 vlan-id=5
add name=vlan2-sfp2 interface=sfp2 vlan-id=2
add name=vlan3-sfp2 interface=sfp2 vlan-id=3
add name=vlan4-sfp2 interface=sfp2 vlan-id=4
add name=vlan5-sfp2 interface=sfp2 vlan-id=5
add name=vlan2-sfp3 interface=sfp3 vlan-id=2
add name=vlan3-sfp3 interface=sfp3 vlan-id=3
add name=vlan4-sfp3 interface=sfp3 vlan-id=4
add name=vlan5-sfp3 interface=sfp3 vlan-id=5
add name=vlan2-sfp4 interface=sfp4 vlan-id=2
add name=vlan3-sfp4 interface=sfp4 vlan-id=3
add name=vlan4-sfp4 interface=sfp4 vlan-id=4
add name=vlan5-sfp4 interface=sfp4 vlan-id=5
Then create a bridge for each vlan.
ros code
/interface brige
add name=bridge-vlan2
add name=bridge-vlan3
add name=bridge-vlan4
add name=bridge-vlan5
and add the appropriate ports to each bridge
ros code
/interface bridge port
add bridge=bridge-vlan2 interface=vlan2-sfp1
add bridge=bridge-vlan2 interface=vlan2-sfp2
add bridge=bridge-vlan2 interface=vlan2-sfp3
add bridge=bridge-vlan2 interface=vlan2-sfp4
add bridge=bridge-vlan2 interface=ether1
add bridge=bridge-vlan3 interface=vlan3-sfp1
add bridge=bridge-vlan3 interface=vlan3-sfp2
add bridge=bridge-vlan3 interface=vlan3-sfp3
add bridge=bridge-vlan3 interface=vlan3-sfp4
add bridge=bridge-vlan3 interface=ether2
add bridge=bridge-vlan3 interface=ether3
add bridge=bridge-vlan3 interface=ether4
add bridge=bridge-vlan3 interface=ether5
add bridge=bridge-vlan3 interface=ether6
add bridge=bridge-vlan4 interface=vlan4-sfp1
add bridge=bridge-vlan4 interface=vlan4-sfp2
add bridge=bridge-vlan4 interface=vlan4-sfp3
add bridge=bridge-vlan4 interface=vlan4-sfp4
add bridge=bridge-vlan4 interface=ether7
add bridge=bridge-vlan4 interface=ether8
add bridge=bridge-vlan4 interface=ether9
add bridge=bridge-vlan4 interface=ether10
add bridge=bridge-vlan5 interface=vlan5-sfp1
add bridge=bridge-vlan5 interface=vlan5-sfp2
add bridge=bridge-vlan5 interface=vlan5-sfp3
add bridge=bridge-vlan5 interface=vlan5-sfp4
add bridge=bridge-vlan5 interface=ether11
add bridge=bridge-vlan5 interface=ether12
-----------------
What you also could do is create a bridge an put all the trunk ports in it
ros code
/interface bridge
add name=bridge-trunk
/interface bridge port
add bridge=bridge-trunk interface=sfp1
add bridge=bridge-trunk interface=sfp2
add bridge=bridge-trunk interface=sfp3
add bridge=bridge-trunk interface=sfp4
Then create the 4 vlan interfaces on the trunk bridge
ros code
/interface vlan
add name=vlan2-tr interface=bridge-trunk vlan-id=2
add name=vlan3-tr interface=bridge-trunk vlan-id=3
add name=vlan4-tr interface=bridge-trunk vlan-id=4
add name=vlan5-tr interface=bridge-trunk vlan-id=5
And then create additional bridges for the ether ports to bridge and put the respective vlan interface into that same bridge
ros code
/interface bridge
add name=bridge-vlan2
add name=bridge-vlan3
add name=bridge-vlan4
add name=bridge-vlan5
/interface bridge port
add bridge=bridge-vlan2 interface=ether2
add bridge=bridge-vlan2 interface=vlan2-tr
add bridge=bridge-vlan3 interface=ether3
add bridge=bridge-vlan3 interface=ether4
add bridge=bridge-vlan3 interface=ether5
add bridge=bridge-vlan3 interface=ether6
add bridge=bridge-vlan3 interface=vlan3-tr
add bridge=bridge-vlan4 interface=ether7
add bridge=bridge-vlan4 interface=ether8
add bridge=bridge-vlan4 interface=ether9
add bridge=bridge-vlan4 interface=ether10
add bridge=bridge-vlan4 interface=vlan4-tr
add bridge=bridge-vlan5 interface=ether11
add bridge=bridge-vlan5 interface=ether12
add bridge=bridge-vlan5 interface=vlan5-tr