Here's the formulation of the linear program and the Gurobi code to solve it:

**Decision Variables:**

* `x`: Number of mountain bikes to stock.
* `y`: Number of road bikes to stock.

**Objective Function:**

Maximize profit: `300x + 500y`

**Constraints:**

* **Demand Constraint:** `x + y <= 150` (Total bikes stocked cannot exceed 150)
* **Budget Constraint:** `750x + 1000y <= 40000` (Total cost of bikes cannot exceed $40,000)
* **Non-negativity Constraints:** `x >= 0`, `y >= 0` (Cannot stock negative numbers of bikes)


```python
import gurobipy as gp

# Create a new model
model = gp.Model("BikeShop")

# Create decision variables
x = model.addVar(lb=0, vtype=gp.GRB.INTEGER, name="mountain_bikes") # Integer number of mountain bikes
y = model.addVar(lb=0, vtype=gp.GRB.INTEGER, name="road_bikes") # Integer number of road bikes


# Set objective function
model.setObjective(300*x + 500*y, gp.GRB.MAXIMIZE)

# Add constraints
model.addConstr(x + y <= 150, "demand")
model.addConstr(750*x + 1000*y <= 40000, "budget")

# Optimize the model
model.optimize()

# Print the results
if model.status == gp.GRB.OPTIMAL:
    print(f"Optimal Solution Found:")
    print(f"Number of mountain bikes: {x.x}")
    print(f"Number of road bikes: {y.x}")
    print(f"Maximum Profit: ${model.objVal}")
elif model.status == gp.GRB.INFEASIBLE:
    print("The model is infeasible.")
else:
    print(f"Optimization terminated with status {model.status}")

```
