This study aimed to determine cortical activation responses to two different rehabilitative programs, as measured through functional near-infrared spectroscopy (fNIRS). As a secondary analysis of the RAGTIME trial, we studied 24 patients with progressive multiple sclerosis (MS) and severe disability who were randomized to a regimen of robot-assisted gait training (RAGT) or overground walking (OW). Cortical activation during a treadmill walking task, assessed through fNIRS recordings from the motor and premotor cortexes (M1/PM), was calculated as the area under the curve (AUC) of oxyhemoglobin for each hemisphere and the total area (Tot-OxyAUC). Gait speed, endurance, and balance were also measured, along with five healthy control subjects. At baseline, Tot-OxyAUC during walking was significantly increased in MS patients compared to healthy people and was significantly higher for those with more severe disabilities; it was also inversely correlated with physical performance. After rehabilitation, significant opposite variations in Tot-OxyAUC were observed, with activity levels being increased after OW and decreased after RAGT (+242,080 ± 361,902 and −157,031 ± 172,496 arbitrary units, respectively; p = 0.002), particularly in patients who were trained at a lower speed. Greater reductions in the cortical activation of the more affected hemisphere were significantly related to improvements in gait speed (r = −0.42) and endurance (r = −0.44). Cortical activation, assessed through fNIRS, highlighted the brain activity in response to the type and intensity of rehabilitation.