To solve this optimization problem, we need to define the decision variables and the objective function, as well as any constraints that apply.

Let's denote:
- \(S\) as the number of sleeper class tickets sold,
- \(R\) as the number of regular tickets sold.

The profit from each sleeper class ticket is $500, and from each regular ticket is $200. Therefore, the total profit (\(P\)) can be represented by the equation:
\[ P = 500S + 200R \]

We have several constraints based on the problem description:
1. The total number of passengers cannot exceed 400: \( S + R \leq 400 \)
2. There are at least 50 seats reserved for sleeper class passengers: \( S \geq 50 \)
3. More than 5 times as many passengers prefer to travel by regular seating than by sleeper class: \( R > 5S \)

However, since we're dealing with linear programming and the constraint \( R > 5S \) is not linear due to the strict inequality, we can reformulate it as \( R \geq 5S + 1 \) to ensure that \(R\) is strictly greater than \(5S\), but in the context of linear programming where we usually deal with "\(\leq\)" or "\(=\)" constraints for simplicity and computational feasibility, this strict inequality can be approximated or handled directly by adding a small constant (e.g., 1) to ensure that the relationship is not just greater than or equal to but strictly greater in practical terms. For linear programming solvers like Gurobi, we'll work with \( R \geq 5S + 1 \), understanding that in practice, this ensures more than five times as many regular seats are sold compared to sleeper class.

The objective is to maximize the profit \( P = 500S + 200R \) under these constraints.

Here's how we can represent this problem using Gurobi in Python:

```python
from gurobipy import *

# Create a model
m = Model("TrainAcrossCanada")

# Define decision variables
S = m.addVar(vtype=GRB.INTEGER, name="sleeper_class_tickets")
R = m.addVar(vtype=GRB.INTEGER, name="regular_tickets")

# Set the objective function to maximize profit
m.setObjective(500*S + 200*R, GRB.MAXIMIZE)

# Add constraints
m.addConstr(S + R <= 400, "total_passengers")
m.addConstr(S >= 50, "sleeper_class_minimum")
m.addConstr(R >= 5*S + 1, "regular_vs_sleeper_ratio")

# Solve the model
m.optimize()

# Print results
if m.status == GRB.OPTIMAL:
    print("Maximum Profit: ", m.objVal)
    print("Sleeper Class Tickets Sold: ", S.x)
    print("Regular Tickets Sold: ", R.x)
else:
    print("Model is infeasible")
```

```python
from gurobipy import *

# Create a model
m = Model("TrainAcrossCanada")

# Define decision variables
S = m.addVar(vtype=GRB.INTEGER, name="sleeper_class_tickets")
R = m.addVar(vtype=GRB.INTEGER, name="regular_tickets")

# Set the objective function to maximize profit
m.setObjective(500*S + 200*R, GRB.MAXIMIZE)

# Add constraints
m.addConstr(S + R <= 400, "total_passengers")
m.addConstr(S >= 50, "sleeper_class_minimum")
m.addConstr(R >= 5*S + 1, "regular_vs_sleeper_ratio")

# Solve the model
m.optimize()

# Print results
if m.status == GRB.OPTIMAL:
    print("Maximum Profit: ", m.objVal)
    print("Sleeper Class Tickets Sold: ", S.x)
    print("Regular Tickets Sold: ", R.x)
else:
    print("Model is infeasible")
```