If you have a L3 or "light" L3 switching you can trunk your uplinks and switch ports and create the VLANs on the switch, IP the VLANs and use inter VLAN routing.
(I can make an example of this in Packet Tracer as well if you like.)
--------
Another option (depending on your network architecture) is to configure your gateway for both VLANs ala router on a stick.
I am going to do an example here for ya in Packet Tracer.
Router
Gi0/1 192.168.1.1
Gi0/1.1 192.168.50.1 VLAN 50
Gi0/1.2 192.168.51.1 VLAN 51
Switch will represent quasi host/switch.
The uplink is simply set to trunk all. In production set to trunk only required VLANs.
On the switch your PG's will be represented by individual ports.
Fa0/1 is VLAN 50
Fa02 is VLAN 51
Now each server in the private VLAN / PG's will be shown as PC's.
PC 1 is 192.168.50.2
PC 2 is 192.168.51.2
See screen shot. Both PC's (servers) can ping each other in the separate VLAN's and simulated port groups.

Also including Packet Tracer File.