Despite horse racing’s waning popularity, Maryland is betting $400 million to help save a neighborhood.