It becomes a FAQ and time to create an article in wiki.
This question usually concerns Roadway Designer (SS2) or Corridor Design (SS4), so to get the correct 3D rails using templates.
Please find an ITL here, but carefully read this article because of limitation.
communities.bentley.com/.../272605
And the answer is that it is not directly possible (unless someone provides the solution) using point constraints in the template. This is because to keep the gauge a rail must be constrained from another using angle/distance constraint. This is the only constraint that preserves the slope distance. But at the same time the point must reach the elevation defined by the cant. But it is not possible to add an additional vertical constraint to this point.
Another issue is that constraints are not the same in left and right curves. Right rail is constrained from left rail in left curve and left rail from right rail in right curve.
This can be solved using display rule.
What can not be solved is to reach the good elevation while using angle/distance constraint. This is because the angle cannot be calculated from the cant but its baseline must be defined by the cant points.
For a 1435 mm gauge and cant of 100mm the error is 0.2mm.
For a 1435 mm gauge and cant of 160mm the error is 1.0mm.
If this error is unacceptable then the solution is to use the Geometry>View Geometry>Rails to create the rails in 3D. Then you must use these 3D rails to control the left and right rails points of your template.
In SS2 you can create the rails in a surface and use these features in point control.
In SS4 I would advise to use the command in the 3D model of the alignment and assign a feature definition to the rails for better management.
When creating point control, you can pick the lines from the corridor 2D model where you could display the reference of the alignment 3D model.
An alternative to point control could be a constraint using Feature Definition. But in SS4 don't forget to add 3D rails to corridor reference.