Brown had an incumbency advantage that Cordray didn't. Compared to Brown, Cordray underperformed in the "Rust Belt" - i.e. northeastern and north-central Ohio. In the current political climate, Democrats must perform reasonably well in this region in order to win statewide (Brown has been the only Democrat to accomplish this after 2012).
Brown also spent 30 million dollars against a not great candidate and underperformed his polling
Cordray lost because Ohio has long been a right leaning state in off years, and has moved further right. The democratic party is in shambles anywhere not in a city, and despite some movement from the suburban voter to the left, it didnt move as much in Ohio as it did everywhere else.