To the best of my knowledge, I think you can only get the node from the RID in the C++ code.
I would suggest using the PinJoint2D node to create a joint through code, rather than working with the physics server directly. That way, you can set its properties and values through the node, removing the need to know the RIDs to setup the joint. Additionally, using a PinJoint2D node will mean you will not have to worry about deleting the pin joint through the physics server either, as the node handles that when it gets deleted.